第三方判断是否有网络

// 判断是否有网络

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;

}

你可能感兴趣的:(第三方判断是否有网络)