UIWebView stringByEvaluatingJavaScriptFromString in background

前端 未结 4 1443
温柔的废话
温柔的废话 2021-02-10 01:29

In an iOS app, I\'m running a fairly large script on a UIWebView using stringByEvaluatingJavaScriptFromString (large in terms of the length of the java

4条回答
  •  一整个雨季
    2021-02-10 02:15

    Anything you do with a UIWebView must be done on the main thread. It's a UI element, so this is why performSelectorInBackground breaks your app.

提交回复
热议问题