dimanche 1 mars 2015

UIWebView is working but it doesn't show anything

I'm using UIWebView in my app for lots of things and I've got this bug that I don't know how to solve. The UIWebView didn't show anything at all. I logged all the UIWebView delegates and from what I could tell, it is working just fine. It showed the correct sequence of logged strings from webView:shouldStartLoadWithRequest:navigationType:, webViewDidStartLoad:, and webViewDidFinishLoad:. And then I added this logging code to see the innerHTML of the web view:



NSString* html = [self.webView stringByEvaluatingJavaScriptFromString:@"document.body.innerHTML"];
NSLog(@"webViewDidFinishLoad: inner HTML string = %@\n", html);


The inner HTML is actually non null so it should've displayed something. Oh and FYI, this behaviour only appears on iPads, but it works fine on iPhones / iPods.


Can you guys please help me? I'm so lost right now.


Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire