虽然让BOOL回来了,但等待10秒后仍无法返回

时间:2013-03-07 19:37:15

标签: ios objective-c cocoa-touch uiwebview

我正在尝试展示一个满载的webview。我不希望用户在加载过程中看到webview。我正在处理一些网页浏览,并且使用webViewDidFinishLoad会让我变得更加复杂,所以我正在尝试做这样的事情:

while(_lastWebView.isLoading)
{
_lastWebView.hidden=YES;
}

_lastWebView.hidden=NO;

但我得到这个消息: void SendDelegateMessage(NSInvocation *):委托()在等待10秒后无法返回。主运行循环模式:kCFRunLoopDefaultMode

我不明白为什么输入循环因为isLoading在加载完成后返回0。

1 个答案:

答案 0 :(得分:7)

不要使用该循环阻止您的UI。它将阻止用户在主线程上执行任何其他操作。

相反,count the number of requests your webView makes, and make it visible when it's done loading

相关问题