美文网首页
第三方判断是否有网络

第三方判断是否有网络

作者: 纯阳子_ | 来源:发表于2016-09-01 22:04 被阅读28次

// 判断是否有网络

Reachability *netWorkStatus = [Reachability reachabilityForInternetConnection];

if (netWorkStatus.currentReachabilityStatus != NotReachable) {

[self loadData];

} else {

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"当前网络不稳定" message:nil delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];

[self.view addSubview:alert];

[alert show];

return;

}

相关文章

网友评论

      本文标题:第三方判断是否有网络

      本文链接:https://www.haomeiwen.com/subject/miuqlttx.html