views:

2683

answers:

1

I am trying to update my iPhone app to work with OS 3.0. I have a UIWebView that shows a page fine. But when I click a link it calls my delegate for didFailLoadWithError and the error is Operation could not be completed. (NSURLErrorDomain error -999.) I verified this is still working with OS 2.2.1, so it is something changed in 3.0.

Any ideas?

+9  A: 

I was able to find the answer here: http://www.iphonedevsdk.com/forum/iphone-sdk-development/6280-uiwebview-didfailloadwitherror-how-get-errors-code-list.html

This thread contained this description for this error: "This error may occur if an another request is made before the previous request of WebView is completed..."

I worked around this by ignoring this error and letting the webview continue to load.

if ([error code] != -999) { //show error alert, etc. }

dp
Better to use the constant NSURLErrorCancelled instead of the literal value -999.
hasseg
this changed me soo much search, thanks!
favo