简体   繁体   English

可达性问题iOS6

[英]Reachability prob ios6

In application Showing Reachability error in ios6.Can any one please help me to sort out this error in reachability ios6,PLease do the needfully. 在ios6中显示可访问性错误的应用程序中。有谁能帮助我找出可访问性ios6中的此错误,请做些必要的事情。

@implementation Reachability
 static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info)
 {
#pragma unused (target, flags)
NSCAssert(info != NULL, @"info was NULL in ReachabilityCallback");
NSCAssert([(NSObject*) info isKindOfClass: [Reachability class]], @"info was wrong class in ReachabilityCall9back");

//We're on the main RunLoop, so an NSAutoreleasePool is not necessary, but is added defensively
// in case someon uses the Reachablity object in a different thread.


Reachability* noteObject = (Reachability*) info;
// Post a notification to notify the client that the network reachability changed.
[[NSNotificationCenter defaultCenter] postNotificationName: kReachabilityChangedNotification object: noteObject];


  }

 - (BOOL) startNotifier
 {
BOOL retVal = NO;
SCNetworkReachabilityContext    context = {0, self, NULL, NULL, NULL};
if(SCNetworkReachabilitySetCallback(reachabilityRef, ReachabilityCallback, &context))
{
    if(SCNetworkReachabilityScheduleWithRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode))
    {
        retVal = YES;
    }
}
return retVal;
  }

Error: 错误:

 Cast of C pointer type 'void *' to Objective-C pointer type 'NSObject *' requires a bridged cast
id objInfo = (__bridge id)info;
NSCAssert([objInfo isKindOfClass: [Reachability class]], @"info was wrong class in ReachabilityCall9back");
Reachability* noteObject = (Reachability*) objInfo ;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM