标签:网络 else shared tle lis rtm net nil sel
[[AFNetworkReachabilityManager sharedManager] startMonitoring];
[[AFNetworkReachabilityManager sharedManager ] setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
switch (status) {
case -1:
NSLog(@"未知网络");
break;
case 0:
NSLog(@"网络不可达");
break;
case 1:
NSLog(@"移动网络");
break;
case 2:
NSLog(@"wifi网络");
break;
default:
break;
}
if(status ==AFNetworkReachabilityStatusReachableViaWWAN || status == AFNetworkReachabilityStatusReachableViaWiFi)
{
NSLog(@"有网");
}else
{
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"网络失去连接" message:nil delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
alert.delegate = self;
[alert show];
}
}];
由于连续调用了两次 导致界面逻辑出现一个没有显示出来就跳转到下一个的bug
标签:网络 else shared tle lis rtm net nil sel
原文地址:http://www.cnblogs.com/Jusive/p/7048597.html