• <small id='68Xnu'></small><noframes id='68Xnu'>

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

      1. <legend id='68Xnu'><style id='68Xnu'><dir id='68Xnu'><q id='68Xnu'></q></dir></style></legend>

        <tfoot id='68Xnu'></tfoot>
      2. iOS 5 UIWebview 委托:WebKit 丢弃了 webView 中未捕获的异常:decidePolicyFo

        时间:2023-10-22

          <tbody id='Favmj'></tbody>
          <bdo id='Favmj'></bdo><ul id='Favmj'></ul>
          <legend id='Favmj'><style id='Favmj'><dir id='Favmj'><q id='Favmj'></q></dir></style></legend>
        • <small id='Favmj'></small><noframes id='Favmj'>

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

                • 本文介绍了iOS 5 UIWebview 委托:WebKit 丢弃了 webView 中未捕获的异常:decidePolicyForNavigationAction的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在使用委托方法 shouldStartLoadWithRequest 来捕获链接点击并处理我的应用程序内的特定情况,而不是允许 webView 导航到链接.在这段代码中,我试图将一个新的 ViewController 推送到堆栈上.在尝试推送视图后,我立即在控制台中收到以下消息崩溃:

                  I am using the delegate method shouldStartLoadWithRequest to catch link clicks and handle specific cases inside my app instead of allowing the webView to navigate to the link. In this code, I am attempting to push a new ViewController onto the stack. Immediately after the attempt to push the view, I get a crash with the following message in my console:

                  WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate:
                  

                  我的代码如下所示:

                  -(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
                      if(decision logic){
                          MyViewController *vc = [[MyViewController alloc] init];
                          [self.navigationController pushViewController:vc animated:YES];
                          [vc release];
                          return NO;
                      }
                  
                      return YES;
                  }
                  

                  我也尝试过使用模式而不是推送新的 viewController.我得到相同的结果.我应该在这里处理任何其他情况吗?

                  I have also tried using a modal instead of pushing a new viewController. I get the same result. Is there any other scenarios I should be handling here?

                  **刚想到这个.我试图推送的视图包含另一个 UIWebView.我应该在过渡之前对第一个 webView 做些什么吗?我只是测试推送一个不包含 webView 的不同视图控制器,它工作正常.

                  ** Just thought of this. The view I'm trying to push contains another UIWebView. Should I be doing something to the first webView before transitioning? I just testing pushing a different view controller that doesn't contain a webView and it worked fine.

                  推荐答案

                  我通过确保在继续之前停止 webview 上的所有先前请求来解决此问题:

                  I fixed this by ensuring that all previous requests on the webview were stopped before continuing:

                  [webview stopLoading];
                  

                  这篇关于iOS 5 UIWebview 委托:WebKit 丢弃了 webView 中未捕获的异常:decidePolicyForNavigationAction的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何可靠地检测 UIWebView 中的链接点击? 下一篇:UIWebView 在加载外部网站时以编程方式设置初始缩放比例?

                  相关文章

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

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