Determining when an EDGE connection comes back after a dropout on an iPhone

被刻印的时光 ゝ 提交于 2019-12-02 16:25:59

Reachability notificataions didn't seem to be reliable for me either, for detecting Wi-Fi. So I just use polling instead. Checking every 5 seconds seems to do no harm.

- (void) checkReachability {
    BOOL connected = ([[Reachability sharedReachability] localWiFiConnectionStatus] == ReachableViaWiFiNetwork);

    // Do something...

    [self performSelector:@selector(checkReachability) withObject:nil afterDelay:5.0];
}
Abhijeet

There is a nice reachability example on the net. it works wonderfully well: http://servin.com/iphone/iPhone-Network-Status.html

But you see, when I try to use it my own way, it just bombs.

Tried to implement it using:

NSString *sCellNetwork;     
 NSString *sNetworkReachable;  

if (flags & kSCNetworkFlagsReachable || flags & kSCNetworkReachabilityFlagsIsWWAN)

{do it} 

 else {
   Network fail alert; 
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!