Skip to content

Commit

Permalink
added checking for obj_arc to determine if the project is using ARC, …
Browse files Browse the repository at this point in the history
…to eliminate the warning
  • Loading branch information
gzbigegg committed Oct 4, 2012
1 parent b2f7c05 commit 2f109da
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Reachability.m
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ -(BOOL)isReachableWithFlags:(SCNetworkReachabilityFlags)flags;
static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info)
{
#pragma unused (target)
#if __has_feature(obj_arc)
Reachability *reachability = ((__bridge Reachability*)info);
#else
Reachability *reachability = ((Reachability*)info);
#endif

// we probably dont need an autoreleasepool here as GCD docs state each queue has its own autorelease pool
// but what the heck eh?
Expand Down Expand Up @@ -212,8 +216,11 @@ -(BOOL)startNotifier
return NO;
}

#if __has_feature(obj_arc)
context.info = (__bridge void *)self;
#else
context.info = (void *)self;
#endif

if (!SCNetworkReachabilitySetCallback(self.reachabilityRef, TMReachabilityCallback, &context))
{
Expand Down

0 comments on commit 2f109da

Please sign in to comment.