【发布时间】:2011-11-12 16:52:04
【问题描述】:
如果用户未连接到互联网并单击 webview 链接,我想添加更改。
-(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Can't connect. Please check your internet Connection" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
}
问题就在这里:
Void (-) 给出错误:(!)一元表达式的参数类型“void”无效
【问题讨论】:
-
这是在 .c 文件还是 .m 文件中?这是在Objective C @implementation 块内吗?之前嵌套在文件中的所有函数都正确吗?