当应用程序首次打开时,我使用此代码检查互联网:
//No Internet Connection error code
-(void)webView:(UIWebView *)webVIEW didFailLoadWithError:(NSError *)error {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"No Internet Connection!" message:@"In order to use this app you need an active Internet connection!" delegate:self cancelButtonTitle:@"Close" otherButtonTitles:nil, nil];
[alert show];
}
//Close app from Alert View
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
exit(0);
}
我有一个具有 jQuery .click() 函数的 UIWebView 应用程序。一旦用户单击该按钮,有没有办法再次检查 Internet?