简体   繁体   English

iOS:有人知道为什么我收到999错误,即使页面加载了吗?

[英]iOS: Does Anyone Know why I'm getting a 999 error, even though the page loads?

I added NSLogs to all of my UIWebView delegate methods and viewDidLoad to track everything, and for some reason I see a 999 error, and multiple "DidFinishLoad" calls. 我将NSLogs添加到我的所有UIWebView委托方法和viewDidLoad来跟踪所有内容,由于某种原因,我看到了999错误,以及多个“DidFinishLoad”调用。 Does anyone know how to optimize this? 有谁知道如何优化这个?

Here's my log: 这是我的日志:

2013-12-25 23:56:51.656 VA[10598:60b] View Did Load
2013-12-25 23:56:52.216 VA[10598:60b] Should Start Load with request.
2013-12-25 23:56:52.219 VA[10598:60b] Webview did start load.
2013-12-25 23:56:53.531 VA[10598:60b] Should Start Load with request.
2013-12-25 23:56:53.536 VA[10598:60b] failed with error. Error Domain=NSURLErrorDomain Code=-999 "The operation couldn’t be completed. (NSURLErrorDomain error -999.)" UserInfo=0x16e4e240 {NSErrorFailingURLKey=http://myexamplesite.com/us/en_us, NSErrorFailingURLStringKey=http://myexamplesite.com/us/en_us}
2013-12-25 23:56:53.549 VA[10598:60b] Webview did start load.
2013-12-25 23:56:54.259 VA[10598:60b] Should Start Load with request.
2013-12-25 23:56:54.260 VA[10598:60b] Webview did start load.
2013-12-25 23:56:54.263 VA[10598:60b] Webview Did Finish Load
2013-12-25 23:56:54.266 VA[10598:60b] Should Start Load with request.
2013-12-25 23:56:54.267 VA[10598:60b] Webview did start load.
2013-12-25 23:56:54.269 VA[10598:60b] Webview Did Finish Load
2013-12-25 23:56:54.293 VA[10598:60b] Should Start Load with request.
2013-12-25 23:56:54.294 VA[10598:60b] Webview did start load.
2013-12-25 23:56:54.300 VA[10598:60b] Should Start Load with request.
2013-12-25 23:56:54.301 VA[10598:60b] Webview did start load.
2013-12-25 23:56:54.402 VA[10598:60b] Should Start Load with request.
2013-12-25 23:56:54.403 VA[10598:60b] Webview did start load.
2013-12-25 23:56:54.405 VA[10598:60b] Webview Did Finish Load
2013-12-25 23:56:54.509 VA[10598:60b] Should Start Load with request.
2013-12-25 23:56:54.510 VA[10598:60b] Webview did start load.
2013-12-25 23:56:54.653 VA[10598:60b] Webview Did Finish Load
2013-12-25 23:56:54.861 VA[10598:60b] Webview Did Finish Load
2013-12-25 23:56:54.914 VA[10598:60b] Webview Did Finish Load
2013-12-25 23:56:54.921 VA[10598:60b] Webview Did Finish Load

Here's how I load my webView in viewDidLoad: 这是我在viewDidLoad中加载webView的方法:

NSURL *url = [NSURL URLWithString:shoeLink];
    NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
    [shoeWebView loadRequest:requestObj];

Is there I way for me to optimize this so that I can get the fastest possible load time? 我可以通过这种方式对其进行优化,以便获得最快的加载时间吗? Thanks and happy holidays! 谢谢,节日快乐!

The UIWebView delegate callback methods for shouldStart, didStart, and didFinish are called for each frame of the webpage that is loaded. 为加载的网页的每个帧调用shouldStart,didStart和didFinish的UIWebView委托回调方法。 That is why you see these calls repeated so many times for certain webpages. 这就是为什么你会看到这些调用对于某些网页重复这么多次的原因。 As you can tell from the logs, something about loading one of those frames fails, but the rest of them load fine, which is why you are still able to see the webpage. 从日志中可以看出,加载其中一个框架的内容失败了,但其余部分加载正常,这就是为什么你仍然可以看到网页的原因。

About the second part of your question, there is no real optimization than can be done to make this all happen faster, you have made the request in the correct way. 关于问题的第二部分,没有真正的优化可以使这一切更快地发生,你已经以正确的方式提出了请求。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 有谁知道如何修复 Thread 1: signal SIGABRT 错误? 我已经尝试清洁我的产品。 我是 iOS 开发的新手 - Does anyone know how to fix a Thread 1: signal SIGABRT error? I have already tried cleaning my product. I'm new to iOS development 有谁知道为什么在ios / cordova中抛出这个异常? - Does anyone know why this exception is being thrown in ios/cordova? 即使我要求在后台更新位置,为什么我的iOS应用程序会被杀死? - Why does my iOS app get killed even though I ask for location updates in the background? 即使安装了 pod,为什么在 swift 中出现“没有此类模块 'ESPProvision'”错误? - Why am I getting "No such module 'ESPProvision'" Error in swift even though the pod is installed? 有谁知道这个 FIRMessaging 错误? - Does anyone know this FIRMessaging error? 当我什至不使用Bolts时,为什么会出现有关Bolts框架和FacebookSDK的错误? - Why am I getting an error regarding Bolts framework and FacebookSDK when I'm not even using Bolts? 即使配置文件设置为可分发,为什么xcode也会引发此错误? - Why does xcode throw this error even though the profiles are set to distribute? 我正在尝试访问ios中的视频聊天,但遇到以下错误:“ _ OBJC_CLASS _ $ _ OTPublisher”,引用自“有人可以帮我吗? - I'm trying to access video chatting in ios but I'm getting the folling error:“_OBJC_CLASS_$_OTPublisher”, referenced from" can anyone help me out? Swift iOS - 即使我隐藏它,导航栏也不会保持隐藏状态 - Swift iOS -Navigation Bar won't stay Hidden even though I'm hiding it 为什么即使所有 IBOutlets 都已连接,我也会收到“此 class 与键的键值编码不兼容”错误? - Why am I getting "this class is not key value coding-compliant for the key" error even though all IBOutlets are connected?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM