1
我得到了我的可达性代码的误报。当网络可用但未激活时,我得到UIAlert“无互联网连接”。很感谢任何形式的帮助。可达性错误肯定
//Check for Internet
Reachability* wifiReach = [[Reachability reachabilityWithHostName: @"www.apple.com"] retain];
NetworkStatus netStatus = [wifiReach currentReachabilityStatus];
switch (netStatus)
{
case NotReachable:
{
NSLog(@"Access Not Available");
break;
}
case ReachableViaWWAN:
{
NSLog(@"Reachable WWAN");
break;
}
case ReachableViaWiFi:
{
NSLog(@"Reachable WiFi");
break;
}
}
if (netStatus==NotReachable){
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Internet Required" message:@"There is no internet connection. Please connect and try again" delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[alert show];
[alert release];
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];
}else{
//Push Controller
}
重复这个问题的 http://stackoverflow.com/questions/3086816/reachability-on-iphone-app-with-a-false-positive-will-it-get-past-apple – enbr
不确切地说,你提到的问题的答案是仅仅不使用可达性。检查出:http://stackoverflow.com/questions/1281232/reachability-sometimes-fails-even-when-we-do-have-an-internet-connection更详细地解释 – iOSDevSF
@ stevebay22是什么让你觉得那不是没有正确的答案吗? – hotpaw2