问题
I keep getting the following message from my iPhone 3.0 when trying to convert a large NSData object into base64Encoding for http transmission :
void SendDelegateMessage(NSInvocation*): delegate failed to return after waiting 10 seconds. main run loop mode: kCFRunLoopDefaultMode
If you were not using the touch screen for this entire interval (which can prolong this wait), please file a bug.
I am using synchronous request and touch screen will be frozen with only UIProgressView displaying status while uploading data. Anyone have any good idea how to resolve this problem ?
回答1:
As it says: you take too long ;D
web view to english: " i called a delegate and it takes too long and I can't continue displaying HTML or running JS"
don't block the web view or it will complain after a while...
so doing a synchronous request? on the main thread? never do that
Better way:
- webView:... {
dispatch_async(dispatch_get_global_queue(0,0), ^{
//DO LONG RUNNING IN BG
dispatch_sync(dispatch_get_main_queue(), ^{
//update UI
}
}
}
回答2:
If you are using the UIWebView
then we need to do this first before moving to the next view
webView.delegate = nil;
来源:https://stackoverflow.com/questions/1618727/iphone-senddelegatemessage-failed-to-return-after-waiting-10-secs