In my iPhone application, I display a webpage in a webview. I applied the delegate method as follows:
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Error loading the requested URL" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
}
When I open the URL and load half the page, I immediately click on another link on the web page. At the same time, this delegate method is called. How can I prevent the delegation method from being called when the web page is half loaded and the URL link is clicked.
Or some other solution might be to call stopLoading when you click on any URL. How can i do this?
source
share