I've got an app loading a local HTML file. The HTML file loads a Google Map within an iFrame. The app has a back button which checks UIWebView.canGoBack and UIWebView.isLoading
Within webViewDidStartLoad and webViewDidFinishLoad I'm tracking outstanding loads as suggested here, so that once I've reached zero outstanding loads I can update the back button's state, etc.
On the first load of the control, once all webViewDidFinishLoads have occurred, canGoBack and isLoading will both return NO.
On the second load of the control, once all webViewDidFinishLoads have occurred, isLoading gets "hung" always returning YES, and (I assume as a result), canGoBack will also return YES even though it's at the top of the stack.
Attaching Safari's debugger I can confirm that there are no outstanding HTTP requests when isLoading is returning YES.
I note that others have seen bugs with canGoBack's behavior in iOS and Safari in the past.
Questions:
- What is UIWebView.isLoading looking at to determine if a web request is done?
- Is it true that UIWebView.canGoBack's value is somehow tied to the isLoading flag?
- Can anyone suggest a work around to evaluating canGoBack?