为什么这个代码不工作?我所有的是这样的:我的UIWebView的alertview不起作用
-(void)_webview:(UIWebView *)_webview didFailLoadWithError:(NSError *)error {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error!" message:@"You have no internet connection!" delegate:self cancelButtonTitle:@"Close" otherButtonTitles:nil, nil];
[alert show];
}
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
exit(0);
}
它应该工作,对不对?
什么叫'并不意味着work',没有给出任何错误?你的.h文件中有吗? –
https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ErrorHandlingCocoa/CreateCustomizeNSError/CreateCustomizeNSError.html –
此外,这绝对与Xcode无关。** – 2013-01-02 17:06:21