等待10秒后,iPhone SendDelegateMessage无法返回 [英] IPhone SendDelegateMessage failed to return after waiting 10 Secs
问题描述
当尝试将大型NSData对象转换为base64Encoding以进行HTTP传输时,我一直从iPhone 3.0中收到以下消息:
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.
我正在使用同步请求,触摸屏将被冻结,只有UIProgressView会在上传数据时显示状态。
任何人都有解决此问题的好主意吗?
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 ?
推荐答案
如其所说:您花费的时间太长; D
的网络视图为英语:我叫了一位代表,时间太长,无法继续显示HTML或运行JS
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"
不要阻止Web视图,否则一段时间后它将抱怨...
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
更好的方式:
- webView:... {
dispatch_async(dispatch_get_global_queue(0,0), ^{
//DO LONG RUNNING IN BG
dispatch_sync(dispatch_get_main_queue(), ^{
//update UI
}
}
}
这篇关于等待10秒后,iPhone SendDelegateMessage无法返回的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!