• <bdo id='et6wk'></bdo><ul id='et6wk'></ul>

        <i id='et6wk'><tr id='et6wk'><dt id='et6wk'><q id='et6wk'><span id='et6wk'><b id='et6wk'><form id='et6wk'><ins id='et6wk'></ins><ul id='et6wk'></ul><sub id='et6wk'></sub></form><legend id='et6wk'></legend><bdo id='et6wk'><pre id='et6wk'><center id='et6wk'></center></pre></bdo></b><th id='et6wk'></th></span></q></dt></tr></i><div id='et6wk'><tfoot id='et6wk'></tfoot><dl id='et6wk'><fieldset id='et6wk'></fieldset></dl></div>

        <small id='et6wk'></small><noframes id='et6wk'>

      1. <tfoot id='et6wk'></tfoot>
      2. <legend id='et6wk'><style id='et6wk'><dir id='et6wk'><q id='et6wk'></q></dir></style></legend>

        即使页面稍后加载,也使用 UIWebView 调用 didFailLoadWithError

        时间:2023-10-22
        1. <small id='N8FAE'></small><noframes id='N8FAE'>

            <tbody id='N8FAE'></tbody>
          <legend id='N8FAE'><style id='N8FAE'><dir id='N8FAE'><q id='N8FAE'></q></dir></style></legend>

              <tfoot id='N8FAE'></tfoot>
                <bdo id='N8FAE'></bdo><ul id='N8FAE'></ul>

                <i id='N8FAE'><tr id='N8FAE'><dt id='N8FAE'><q id='N8FAE'><span id='N8FAE'><b id='N8FAE'><form id='N8FAE'><ins id='N8FAE'></ins><ul id='N8FAE'></ul><sub id='N8FAE'></sub></form><legend id='N8FAE'></legend><bdo id='N8FAE'><pre id='N8FAE'><center id='N8FAE'></center></pre></bdo></b><th id='N8FAE'></th></span></q></dt></tr></i><div id='N8FAE'><tfoot id='N8FAE'></tfoot><dl id='N8FAE'><fieldset id='N8FAE'></fieldset></dl></div>

                  本文介绍了即使页面稍后加载,也使用 UIWebView 调用 didFailLoadWithError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个 UIViewController,它是一个 UIWebViewDelegate,里面有一个 UIWebView.我正在尝试加载特定的 URL

                  I have a UIViewController which is a UIWebViewDelegate and has a UIWebView inside of it. I am trying to load a particular URL

                      NSURL *url = [NSURL URLWithString:urlAddress];
                      NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
                      [webView loadRequest:requestObj];
                      [self.view addSubview:webView];
                      [webView release];
                  

                  但是didFailLoadWithErrordelegate方法几乎是瞬间被调用,错误对象是:

                  But the didFailLoadWithErrordelegate method is almost instantly called, and the error object is:

                  Did fail load with error: Error Domain=NSURLErrorDomain Code=-999 "The operation couldn’t be completed. (NSURLErrorDomain error -999.)" UserInfo=0x1a66c0 {NSErrorFailingURLKey=www.somewebsite.com, NSErrorFailingURLStringKey=www.somewebsite.com}
                  

                  但是不久之后,您可以看到网站加载正常.

                  However a short time after, you can see that the website loads just fine.

                  为什么调用fail方法?以及无论网站是否实际失败,我如何知道它何时实际失败以及何时调用该方法?

                  Why is the fail method being called? And how do I know when it has actually failed versus when the method was called regardless of if the website actually failed or not?

                  推荐答案

                  当页面通过 javascript 或其他方式立即重定向时,您会收到此错误

                  You can get this error when the page is instantly redirected via javascript or somehow else

                  您可以通过此处的答案避免显示错误:如何修复 iPhone 3.0 操作系统中的 NSURLErrorDomain 错误 -999

                  You can avoid showing the error by answer from here: How do I fix NSURLErrorDomain error -999 in iPhone 3.0 OS

                  喜欢

                  if ([error code] != NSURLErrorCancelled) { //show error alert, etc. }
                  

                  但我不知道如何识别它被调用的位置.

                  but I don't know how to recognize where it was invoked.

                  这篇关于即使页面稍后加载,也使用 UIWebView 调用 didFailLoadWithError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:使用 GCD 调用 UIWebView stringByEvaluatingJavaScriptFromString 在 下一篇:Webview 自动调整大小为 iphone 中的纵向和横向视图

                  相关文章

                      <bdo id='pwQKb'></bdo><ul id='pwQKb'></ul>
                  1. <small id='pwQKb'></small><noframes id='pwQKb'>

                  2. <tfoot id='pwQKb'></tfoot>
                      <legend id='pwQKb'><style id='pwQKb'><dir id='pwQKb'><q id='pwQKb'></q></dir></style></legend>
                    1. <i id='pwQKb'><tr id='pwQKb'><dt id='pwQKb'><q id='pwQKb'><span id='pwQKb'><b id='pwQKb'><form id='pwQKb'><ins id='pwQKb'></ins><ul id='pwQKb'></ul><sub id='pwQKb'></sub></form><legend id='pwQKb'></legend><bdo id='pwQKb'><pre id='pwQKb'><center id='pwQKb'></center></pre></bdo></b><th id='pwQKb'></th></span></q></dt></tr></i><div id='pwQKb'><tfoot id='pwQKb'></tfoot><dl id='pwQKb'><fieldset id='pwQKb'></fieldset></dl></div>