title: Displaying an alert view when Reachability connection is lost
body: <p>I am trying to monitor Rechability in two ways. Connection to a host and connection to the internet. For either I am trying to display a UIAlertView. This works fine at the moment.</p>
  
  <p>What I am trying to acheive is if the user clicks the alert view button for it to check reachability again, but I am not sure how to do this. Ideally I do not want the alertview to dismiss and show again but stay shown and simply request reachability check again. Is this possible? </p>
  
  <p>This is my current appdelegate imp code, used in appdelegate as I want to check the connection at any point at the moment. </p>
  
  <pre><code>- (void)monitorReachability {
  [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reachabilityChanged:) name:ReachabilityChangedNotification object:nil];
  
      self.hostReach = [Reachability reachabilityWithHostName: @"api.parse.com"];
      [self.hostReach startNotifier];
  
      self.internetReach = [Reachability reachabilityForInternetConnection];
      [self.internetReach startNotifier];
  
  }
  
  //Called by Reachability whenever status changes.
  - (void)reachabilityChanged:(NSNotification* )note {
      NetworkStatus internetStatus = [self.internetReach currentReachabilityStatus];
  
      switch (internetStatus) {
          case NotReachable:
          {
              isReachable=NO;
              break;
          }
          case ReachableViaWiFi:
          {
              NSLog(@"The internet is working via WIFI.");
              isReachable=YES;
              break;
          }
          case ReachableViaWWAN:
          {
              NSLog(@"The internet is working via WWAN.");
              isReachable=YES;
              break;
          }
      }
  
      NetworkStatus hostStatus = [self.hostReach currentReachabilityStatus];
  
      switch (hostStatus) {
          case ReachableViaWWAN:
          {
              hostActive=YES;
              break;
          }
          case ReachableViaWiFi:
          {
              hostActive=YES;
              break;
          }
          case NotReachable:
          {
              hostActive=NO;
              break;
          }
  
      }
  
  
      if (hostActive == YES &amp;&amp; isReachable == YES) {
          connectionNotReachable.hidden = YES;
      }
  
      if (isReachable == NO) {
          NSLog(@"Internet connection lost");\
          connectionNotReachable = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"connectionNotReachableTitle", @"Title for alert view - connection Not Reachable") message:NSLocalizedString(@"connectionNotReachableMessage", @"Message for alert view - connection Not Reachable") delegate:self cancelButtonTitle:nil otherButtonTitles:NSLocalizedString(@"connectionNotReachableTryAgain", @"Try again button for alert view - connection Not Reachable"), nil];
  
          [connectionNotReachable show];
          return;
      }
  
      if (hostActive == NO) {
          NSLog(@"Host not active, internet connection");
          UIAlertView *hostNotReachable = [[UIAlertView alloc] initWithTitle:@"Host Not Reachable" message:@"No Host" delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
          [hostNotReachable show];
          return;
      }
  }
  </code></pre>