How to handle an error while loading a UIWebView

If you’re conforming to the UIWebViewDelegate protocol the webView:didFailLoadWithError: method gets triggered when there has been a problem.
Call it like this and display an error message (in this case a UIAlertView):

This method is also a good opportunity to stop any loading animations you’ve got going.





Leave a Reply