I am developing an app, which uses UIWebView. I am implementing the manual load counting method as in UIWebView - How to identify the "last" webViewDidFinishLoad message?
I can see the calls for start/finish/failLoad balanced in principle. However, with a few web pages (most particularly, google.com), the page initially loads well and after a few seconds automatically (seems to) refresh itself. The start/finish sequence looks as below:
-[MyWebView webViewDidStartLoad:], 1, 0x895150c
-[MyWebView webView:didFailLoadWithError:], 0, 0x895150c
-[MyWebView webViewDidStartLoad:], 1, 0x895150c
-[MyWebView webViewDidStartLoad:], 2, 0x895150c
-[MyWebView webViewDidFinishLoad:], 1, 0x895150c
-[MyWebView webViewDidFinishLoad:], 0, 0x895150c
-[MyWebView webViewDidStartLoad:], 1, 0x895150c <-- after a few seconds' gap
-[MyWebView webViewDidFinishLoad:], 0, 0x895150c
The first argument is the function being called, second is the value of the counter and the last value is the address of the loadCounter, just to confirm that it is the same webView instance (and hence the counter) being called. I am running out of clues :(...
Does anyone have any clue, what might be happening here? (BTW, this does not happen for many other websites, so far only with Google)
EDIT: Why it matters to me is, because while it refreshes (apparently randomly), it dismisses the keyboard. This is annoying if a user is already in the middle of typing something. Is it possible to relegate any further refreshes to the site in the background, while continuing the user interaction (particularly keyboard) in the front?
TIA, Nikhil