Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

failed to return after waiting 10 seconds although getting a BOOL back

I'm trying to show a fully loaded webview. I don't want the user to see the webview in the loading process. I'm handling a few webviews at a time and using webViewDidFinishLoad makes it a lot more complex for me so I'm trying to do something like this:

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

_lastWebView.hidden=NO;

But I get this msg: void SendDelegateMessage(NSInvocation *): delegate () failed to return after waiting 10 seconds. main run loop mode: kCFRunLoopDefaultMode

I don't understand why is entering a loop because isLoading returns 0 when the loading is finished.

like image 973
Segev Avatar asked Mar 07 '13 19:03

Segev


1 Answers

Don't block your UI with that loop. It will stop the user from doing anything else on the main thread.

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

like image 175
Aaron Brager Avatar answered Sep 18 '22 14:09

Aaron Brager