UIWebView stringByEvaluatingJavaScriptFromString hangs on iOS5.0/5.1 when called using GCD

后端 未结 4 927
野的像风
野的像风 2020-12-10 05:46

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 dis

4条回答
  •  死守一世寂寞
    2020-12-10 05:47

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

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

    will solve it.

提交回复
热议问题