0

I have a problem similar to what has been described here.

I install the app for the first time. Log in to the app. Load the webView but the content is not visible. I log out. Log in again. From now on webView loads perfectly. However my url does not require any authentication. I copy paste the url in my browser and it loads normally.

Kindly refrain from suggesting loading the webView from any view life cycle methods. Its not just the flow of the app. Thank you.

Edit: Forgot to mention one weird detail. The problem is not in simulator. It works fine there. Its just in the device.

Community
  • 1
  • 1
Rishab
  • 1,901
  • 2
  • 18
  • 34

3 Answers3

1

I think the issue might be with your web view not getting memory allocation before you load the URL request in it.

Please check the same and try to call the URL request after your web view is actually in memory.

Yogi
  • 3,578
  • 3
  • 35
  • 56
0

You nee to check readyState when webView loading. Please try this code. Its may be helpful to you

- (void)webViewDidFinishLoad:(UIWebView *)webView {
  if ([[webView stringByEvaluatingJavaScriptFromString:@"document.readyState"] isEqualToString:@"complete"]) {
    // UIWebView object has fully loaded.
  }
}
Vijay Kachhadiya
  • 366
  • 2
  • 11
-1

I stumble on the same issue and the problem was the actual website. I was able to prove it by loading the page from a Chrome incognito window. The web page will not load correctly the first time, but will upon hitting refresh.