title: Xcode - Implement network error alerts into my app? Cant get it to work?
body: <p>I have downloaded and added apples reachability(.h+.m) files to my view bases project and not made any changes. I have also added the systemconfiguration.framework.</p>
  
  <p>In my viewcontroller.h file I have added "@class reachability" just before "@interface", and I have also added "- (void) checkNetworkStatus:(NSNotification *)notice;" just before "@end".</p>
  
  <p>I have imported reachability.h into my viewcontroller.m file, here is the rest of it:</p>
  
  <blockquote>
    <p>// check for internet connection
            [[NSNotificationCenter defaultCenter] addObserver:self           selector:@selector(checkNetworkStatus:) name:kReachabilityChangedNotification object:nil];</p>
  </blockquote>
  
  <pre><code>    internetReachable = [[Reachability reachabilityForInternetConnection]             retain];
      [internetReachable startNotifier];
  
      // check if a pathway to a random host exists
      hostReachable = [[Reachability reachabilityWithHostName: @"www.apple.com"]          retain];
      [hostReachable startNotifier];
  
      // now patiently wait for the notification
  
  - (void) checkNetworkStatus:(NSNotification *)notice
  {
      // called after network status changes
  
      NetworkStatus internetStatus = [internetReachable            currentReachabilityStatus];
      switch (internetStatus)
  
  {
          case NotReachable:
  {
              NSLog(@"The internet is down.");
              self.internetActive = NO;       
              break;              
  }
          case ReachableViaWiFi:
  {
              NSLog(@"The internet is working via WIFI.");
              self.internetActive = YES;
  
              break;
  
  }
          case ReachableViaWWAN:
  {
              NSLog(@"The internet is working via WWAN.");
              self.internetActive = YES;
  
              break;
  }
  }
      NetworkStatus hostStatus = [hostReachable currentReachabilityStatus];
      switch (hostStatus)     
  {
          case NotReachable:
  {
              NSLog(@"A gateway to the host server is down.");
              self.hostActive = NO;
  
              break;
  
  }
          case ReachableViaWiFi:
  {
              NSLog(@"A gateway to the host server is working via WIFI.");
              self.hostActive = YES;
  
              break;
  
  }
          case ReachableViaWWAN:
  {
              NSLog(@"A gateway to the host server is working via WWAN.");
              self.hostActive = YES;
  
              break;              
  }
  }
  }
  }
  
  - (void)didReceiveMemoryWarning
  {
  // Releases the view if it doesn't have a superview.
  [super didReceiveMemoryWarning];
  
  // Release any cached data, images, etc that aren't in use.
  }
  
  - (void)viewDidUnload
  {
  // Release any retained subviews of the main view.
  // e.g. self.myOutlet = nil;
  }
  
  
  - (void)dealloc:(BOOL)animated
  {       
  [[NSNotificationCenter defaultCenter] removeObserver:self];
  
      [super dealloc];
  }
  
  @end
  </code></pre>
  
  <p>I get 2 warnings:
  -"Incorrect implementation of class 'TestViewController'" (which worked before I tried to do this)
  -And also, "method definition for -'checkNetworkStatus:' not found"</p>
  
  <p>The 2 errors are:
  -"'checkNetworkStatus' undeclared"
  -And "expected ';' before ':'"</p>
  
  <p>Can anyone please help me?</p>
  
  <p>EDIT:</p>
  
  <p>.h file:</p>
  
  <pre><code>&gt;#import &lt;UIKit/UIKit.h&gt;
  
  @class Reachability;
  
  @interface TestViewController : UIViewController {
  
  IBOutlet UIView *landscape;
  IBOutlet UIView *portrait;
  IBOutlet UIView *portraitupsidedown;
  
  IBOutlet UIWebView *WebView;
  IBOutlet UIWebView *WebView2;
  IBOutlet UIWebView *WebView3;
  IBOutlet UIWebView *WebView4;
  
  Reachability* internetReachable;
      Reachability* hostReachable;
  }
  
  @property(nonatomic,retain) UIView *landscape;
  @property(nonatomic,retain) UIView *portrait;
  @property(nonatomic,retain) UIView *portraitupsidedown;
  
  - (void) checkNetworkStatus:(NSNotification *)notice;
  
  @end
  </code></pre>