Xcode Webview Internet连接警报

时间:2014-06-11 12:26:57

标签: ios xcode

所以我已经完成了我的申请,我想知道是否必须添加检查用户是否与互联网有效连接的代码?我问这个的原因之一是因为在我以前的应用程序中我使用了以下这段代码。

- (void) webView:(UIWebView*) webview didFailLoadWithError:(NSError *)error {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Important" message:@"Sorry, 
 it seems you are not currently connected to a network, please try again later." delegate:self    
cancelButtonTitle:@"I understand" otherButtonTitles: nil];

 [alert show];
 }  

我用过这个我相信Xcode 4和iOS 6我相信在Xcode 5.1.1和iOS 7中有所改变,或者我做错了什么。对不起听起来很愚蠢,但它确实让我烦恼。

谢谢

1 个答案:

答案 0 :(得分:0)

不需要,并且未在Apple的条款和条件中指定任何地方。但是,如果遇到某种问题,它是一种警告用户的标准程序。我强烈建议您实现这些委托方法。