Note that there are some explanatory texts on larger screens.

plurals
  1. POUIWebView: webViewDidStartLoad/webViewDidFinishLoad delegate methods not called when loading certain URLs
    text
    copied!<p>I have basic web browser implemented using a <code>UIWebView</code>. I've noticed that for some pages, none of the <code>UIWebViewDelegate</code> methods are called.</p> <p>An example page in which this happens is: <a href="http://www.youtube.com/user/google" rel="noreferrer">http://www.youtube.com/user/google</a>. Here are the steps to reproduce the issue (make sure you insert <code>NSLog</code> calls in your controller's <code>UIWebViewDelegate</code> methods):</p> <ol> <li>Load the above youtube URL into the <code>UIWebView</code> [notice that here, the <code>UIWebViewDelegate</code> methods do get called when the page loads]</li> <li>Touch the "Uploads" category on the page</li> <li>Touch any video in that category [<strong>issue:</strong> notice that a new page is loaded, but none of the UIWebView delegates are called]</li> </ol> <p>I know that this is not an issue of <code>UIWebView</code>'s delegate not being set properly, since the delegate methods do get invoked when loading other links (e.g. if you try clicking on a link that takes you outside of youtube, you'll notice the delegate methods getting called).</p> <p>My gut feeling initially was that it might be because the page is loaded using AJAX, which may not invoke the delegate method. But then when I checked the iPhone's Safari, it did not exhibit this problem, so it must be something on my side.</p> <p>I've also noticed that Three20's <code>TTWebController</code> has the exact same issue as I'm having.</p> <p>But the problem that arises from this issue is that without the delegate methods called, I'm unable to update the UI to enable/disable the back and forward browsing buttons when new requests are loaded.</p> <p>And idea why this is happening or how can I work around it to update the UI when a new request is made?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload