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
UIWebView
stringByEvaluatingJavaScriptFromString
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.
performSelectorInBackground