Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

failed to return after waiting 10 seconds - UIWebView loadHTMLString

Tags:

ios

uiwebview

when I load a UIWebView with the following code:

NSString *helpText = [NSString stringWithFormat:@"Lorem Ipsum"];

[self.helpWebView loadHTMLString:[NSString stringWithFormat:@"<html><head></head><body stlye=\"background-color: transparent;\"><div align='justify' style=\"color: #000000; font-family: Helvetica; font-size: %fem;\">%@</div></body></html>", fontSize, helpText] baseURL:[NSURL URLWithString:@""]];

I get this error, but only the first time when a WebView is loaded in my app:

void SendDelegateMessage(NSInvocation *): delegate (webView:decidePolicyForNavigationAction:request:frame:decisionListener:) failed to return after waiting 10 seconds. main run loop mode: kCFRunLoopDefaultMode

And the text will load, but only after 10 seconds. But the UI is blocked for 10 Seconds. When I navigate through the app, other ("later") UIWebViews will load immediately and it is not related to this specific UIWebView, i.e. if I got to UIWebView A and then to UIWebView B, A will load after 10 seconds of UI blocking and B will load instantly. IF it starts with B and then goes to A, B will load after 10 seconds and A will load instantly. So, only the first UIWebView which is loaded creates a problem.

And I really only load the html above. Some douzen of characters, no JScript, no big tables, no funny html stuff. It will even block the UI and report the error message if I load a blank HTML-String.

I have not set any delegate stuff or something like this. I created the UIWebView in Interface Builder, connected it to the header via property and I am using loadHTMLString to get content into.

Important: I can currently only use the Simulator, so I cannot predict, whether this is only a Simulator issue. If you know it, please let me know. At the moment, I cannot test at a real device. The Simulator should not go into this error because of ressources however. I have a current MacBook Air and almost no extra programs installed ("clean installation" of Mac OS X Lion).

Another Point: The only reason why I use UIWebView is that I need full justification for the text. If this would work any other way, would help me too. At least from Android development, I know that there is no other way than a WebView.

like image 380
Martin Freitag Avatar asked Jan 28 '13 22:01

Martin Freitag


1 Answers

I think the problem is solved with the update from today (iOS 6.1 SDK) and I also think it is related to the simulator. I think it is about interfering outgoing requests from skpaymenttransaction and other UIWebView... I am not sure about anything, however...

like image 176
Martin Freitag Avatar answered Oct 12 '22 08:10

Martin Freitag