• <legend id='aHkTF'><style id='aHkTF'><dir id='aHkTF'><q id='aHkTF'></q></dir></style></legend>

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

      1. <tfoot id='aHkTF'></tfoot>

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

        使用 GCD 调用 UIWebView stringByEvaluatingJavaScriptFromString 在

        UIWebView stringByEvaluatingJavaScriptFromString hangs on iOS5.0/5.1 when called using GCD(使用 GCD 调用 UIWebView stringByEvaluatingJavaScriptFromString 在 iOS5.0/5.1 上挂起)
        <tfoot id='86Kb8'></tfoot>
      2. <legend id='86Kb8'><style id='86Kb8'><dir id='86Kb8'><q id='86Kb8'></q></dir></style></legend>
          <tbody id='86Kb8'></tbody>
      3. <small id='86Kb8'></small><noframes id='86Kb8'>

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

                  本文介绍了使用 GCD 调用 UIWebView stringByEvaluatingJavaScriptFromString 在 iOS5.0/5.1 上挂起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在 viewDidLoad 中有以下代码,它在 iOS 4.3 上正常工作,但在 iOS 5/5.1 上挂起.在 iOS 5/5.1 上,警告对话框显示但无法关闭,UI 线程冻结,无法单击 OK 按钮.

                  I have the following code in viewDidLoad, which works properly on iOS 4.3, but it hangs on iOS 5/5.1. On iOS 5/5.1, the alert dialog is shown but can not be dismissed, the UI thread freezes, the OK button just can not be clicked.

                  dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
                      dispatch_sync(dispatch_get_main_queue(), ^{
                          [self.webview stringByEvaluatingJavaScriptFromString:@"alert('HELLO WORLD!')"];
                      });
                  });
                  

                  这是一个错误吗?

                  推荐答案

                  测试后认为是Bug,改代码使用

                  After test, I consider it as a Bug, and changing code to use

                  [webView performSelectorOnMainThread:@selector(stringByEvaluatingJavaScriptFromString:) withObject:js waitUntilDone:NO]
                  

                  会解决的.

                  这篇关于使用 GCD 调用 UIWebView stringByEvaluatingJavaScriptFromString 在 iOS5.0/5.1 上挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  EAAccessory/EASession teardown during background(EAAccessory/EASession 在后台拆除)
                  Getting an NSArray of a single attribute from an NSArray(从 NSArray 获取单个属性的 NSArray)
                  ImageIO: lt;ERRORgt; JPEG Corrupt JPEG data: premature end of data segment iphone - how to catch this?(ImageIO:lt;错误gt;JPEG 损坏的 JPEG 数据:iphone 数据段过早结束 - 如何捕捉到这个?)
                  How to get indexPath.row of tableView which is currently being displayed?(如何获取当前正在显示的 tableView 的 indexPath.row?)
                  Xcode iOS organizer submit to app store yields quot;The archive is invalidquot; error(Xcode iOS 管理器提交到应用商店产生“存档无效;错误)
                  MFMessageComposeViewController alloc returns nil(MFMessageComposeViewController alloc 返回 nil)
                  <tfoot id='6fdAL'></tfoot>
                    <tbody id='6fdAL'></tbody>

                        <small id='6fdAL'></small><noframes id='6fdAL'>

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