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 didFailL
In webViewDidFinishLoad:
if ([[(NSHTTPURLResponse*)[[NSURLCache sharedURLCache] cachedResponseForRequest:webView.request] valueForHTTPHeaderField:@"Status"] intValue] == 404){
}
You may consider this solution over other more complex ones, even though some responses might not get cached. Note that wrong urls are usually getting cached by a system which has default configurations.