1

I am using a UIWebView in my app and I am overriding the shouldStartLoadWithRequest message to detect what kind of link is being clicked. If it's a "special" link, I push a UIViewController onto the stack and return NO from this method. This works just dandy most of the time.

Sometimes, however, I click on a link and my shouldStartLoadWithRequest never gets called. Now what's weird is that the UIViewController which houses the UIWebView is in a UITabBarController and when I click on another tab, the UIWebView finally gets its shouldStartLoadWithRequest called. Until I click this other tab, I do NOT get a call to shouldStartLoadWithRequest. The other interesting bit is that the failure case never happens the first time I click on a link; it's always on a subsequent time.

Has anyone seen this? To me, this sounds like the UIWebView is, sometimes, not getting a touchEnded event and by switching tabs, the underlying framework is forcing a touchEnded event which in turn causes my shouldStartLoadWithRequest to get called.

Jay Bhalani
  • 4,142
  • 8
  • 37
  • 50
salil
  • 407
  • 3
  • 14

1 Answers1

0

Are you implementing the

– webView:didFailLoadWithError:

method from the UIWebViewDelegate? Perhaps you're getting an error on the request and then you're never seeing it? This delegate should get thrown when you have issue such as timeouts and other things.

dsingleton
  • 976
  • 6
  • 7
  • I was. I ended up reworking this code to use native UITableViews so the question is kind of meaningless now :) Thanks for the help though. – salil May 17 '12 at 23:47