第三方判断是否有网络

2016-09-01  本文已影响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;

}

上一篇 下一篇

猜你喜欢

热点阅读