I want to inform user when HTTP error 404 etc is received. How can I detect that?
I’ve already tried to implement
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
but it is not called when I receive 404 error.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could capture the URLRequest here:
and hand the request over to the delegate and return no. Then in the received response call from
NSURLConnectioncancel the connection and if everything is fine (check response) load the urlrequest once more in the webview. Make sure to return YES in the above call when loading the urlrequest again.Not very elegant, but it might work.