title: Xcode - Adding network error alert code into my app?
body: <p>Hi I want to add network error code into my iPhone app, heres what I have got up to now:</p>
  
  <pre><code>- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {
      UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"The page couldn't load, please check your internet connection and reopen the app." delegate:self
      cancelButtonTitle:@"Dismiss" otherButtonTitles:nil];
      [alert show];
      [alert release];
  }
  </code></pre>
  
  <p>I have linked the webview in question in interface builder with delegate.
  It works on simulator quite well, but when I run it on my iPhone I realised a few things. It only works upon opening up the app the first time when theres no internet connection, if you open the app later with no internet connection and it's still in the multitasking bar it doesn't work. It doesn't work if you lose internet connection while using the app and try to load another page, and that leads on to that currently I have only added this code for 1 uiwebview, while I have 4 otherwise if the error does show up, it shows up 4 times. I need to work out a way to link it to all uiwebviews, but it will only show up once if there is no connection.</p>
  
  <p>Thanks for help in advance.</p>