1,网页载入成功,但是还是调用了载入失败方法
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {}
打印信息:
Code=-999 "
** error = Error Domain=NSURLErrorDomain Code=-999 "(null)" UserInfo={NSErrorFailingURLStringKey=http://www.lagou.com/frontflfail.do?action=grantST&ticket=ST-flfail&fl=1&osc=PASSPORT._ascb%280%29&ofc=PASSPORT._afcb%280%29&pfurl=http%253A%252F%252Fwww.lagou.com%252Fcenter%252Fcompany_67900.html%253Fm%253D1&flfail=fail&ifWeixinRequest=false, NSErrorFailingURLKey=http://www.lagou.com/frontflfail.do?action=grantST&ticket=ST-flfail&fl=1&osc=PASSPORT._ascb%280%29&ofc=PASSPORT._afcb%280%29&pfurl=http%253A%252F%252Fwww.lagou.com%252Fcenter%252Fcompany_67900.html%253Fm%253D1&flfail=fail&ifWeixinRequest=false}**
一个解释
http://www.cnblogs.com/Hinagiku/p/3736660.html
处理:过滤错误的错误提示
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {
NSLog(@"Error %i", error.code);
if (error.code == NSURLErrorCancelled) return; // this is Error -999
// error handling for "real" errors here
}
但是,使用的上面的代码,比没有软用。。。
2,图片不能正确显示

情况1:
图片文件格式不对,实际上是个文本格式
测试方法:
使用safari 浏览器打开图片路径,如果不能正确的展示图片,而是下载了文件,说明文件格式不正确。

使用谷歌浏览器打开,是能够正确显示图片的,开发者工具查看,文件类型是 document

网友评论