Failed to return after waiting 10 seconds, although getting BOOL back

I am trying to show a fully loaded webview. I do not want the user to view the web view during the download process. I process several web views at a time, and using webViewDidFinishLoad makes it a lot more complicated for me, so I'm trying to do something like this:

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

But I get this message: void SendDelegateMessage (NSInvocation *): delegate () could not return after waiting 10 seconds. main launch mode: kCFRunLoopDefaultMode

I don’t understand why to introduce a loop because isLoading returns 0 when the download is complete.

+4
source share
1 answer

Do not block your interface with this loop. This will force the user to do something else in the main thread.

Instead, count the number of requests your webView makes and make them visible when loading .

+6
source

All Articles