iphone - Reachability prob ios6 -
in application showing reachability error in ios6.can 1 please help me sort out error in reachability ios6,please needfully.
@implementation reachability static void reachabilitycallback(scnetworkreachabilityref target, scnetworkreachabilityflags flags, void* info) { #pragma unused (target, flags) nscassert(info != null, @"info null in reachabilitycallback"); nscassert([(nsobject*) info iskindofclass: [reachability class]], @"info wrong class in reachabilitycall9back"); //we're on main runloop, nsautoreleasepool not necessary, added defensively // in case someon uses reachablity object in different thread. reachability* noteobject = (reachability*) info; // post notification notify client 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; } } homecoming retval; }
error:
cast of c pointer type 'void *' objective-c pointer type 'nsobject *' requires bridged cast
id objinfo = (__bridge id)info; nscassert([objinfo iskindofclass: [reachability class]], @"info wrong class in reachabilitycall9back"); reachability* noteobject = (reachability*) objinfo ;
iphone ios6
No comments:
Post a Comment