Hey Guys,
I have a UIWebView within my application which I'm using to provide web browsing functionality.
I have a button on my toolbar which calls
-(void)stopLoading;
on the UIWebView. The problem with this is that when this method is sent to the web view, the delegate receives the
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error;
message. The error accompanying this call is: Operation could not be completed. (NSURLErrorDomain error -999.)
I also use the didFailLoad message to tell if the page actually failed to load - and in that case, I display an html formatted message to user to communicate this failure to them.
So the problem is that if the user hits the stop button, the error page is shown instead of just showing whatever parts of the page loaded before being stopped.
I had hoped that NSError.h contained an enum of error codes that I could compare against - but it seems like I'll have to make my own based on my observations of the error codes that come out in my logs - which is less than ideal, since they could change in the future...
Any suggestions would be great, thanks.