iPhone ShouldStartLoad fires once per click?

260 views Asked by At

In my UIWebView when an anchor is clicked I catch it in ShouldStartLoad and always return false to cancel it. (I treat the clicks as command to do things)

Strangely the ShouldStartLoad only fires once if the same anchor is clicked more than once in a row.

Eg: Click "A", Click "A" - ShouldStartLoad receives "A" once

Click "A", Click "B", Click "A" - ShouldStartLoad receives "A", then "B" then "A"

Is there a way to make ShouldStartLoad receive "A" twice when clicked twice in a row?

I have tried changing the URL of "A" each time so that every click is a different url. However it appears that once I click an element clicking it again simply does not fire ShouldStartLoad until I click a different element.

1

There are 1 answers

0
Ian Vink On BEST ANSWER

As a work around in ShouldStartLoad I do this to cause the page the re-register that it's new. Not sure why it works, but it does.

webView.EvaluateJavascript ("document.location='#';");

(I use MonoTouch)