title: Reachability Notification Never Called
body: <p>I am having a hard time using Reachability in my code. I would like to keep it very simple by initiating an observer at launch and then just receiving change notifications. In the following code, the reachabilityChanged method is never called. I’ve tried many iterations but this is the simplest version. It compiles and runs. Please help...</p>
  
  <p><em><strong></em>**<em>*</em>*</strong> AppDelegate.h code <strong><em>*</em>**<em>*</em></strong> </p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  #ifdef PHONEGAP_FRAMEWORK
      #import &lt;PhoneGap/PGViewController.h&gt;
      #import &lt;PhoneGap/PGURLProtocol.h&gt;
      #import &lt;PhoneGap/Reachability.h&gt;
  #else
      #import "PGViewController.h"
      #import "PGURLProtocol.h"
      #import "Reachability.h"
  
  #endif
  
  @interface AppDelegate : NSObject &lt; UIApplicationDelegate, UIWebViewDelegate, PGCommandDelegate&gt; {
      NSString* invokeString;
  }
  
  @property (nonatomic, copy)  NSString* invokeString;
  @property (nonatomic, strong) IBOutlet UIWindow* window;
  @property (nonatomic, strong) IBOutlet PGViewController* viewController;
  
  @end
  </code></pre>
  
  <p><em><strong></em>**<em>*</em>*</strong> AppDelegate.m code snippet <strong><em>*</em>**<em>*</em></strong></p>
  
  <pre><code>#import "AppDelegate.h"
  
  #import "MainViewController.h"
  
  #ifdef PHONEGAP_FRAMEWORK
      #import &lt;PhoneGap/PGPlugin.h&gt;
      #import &lt;PhoneGap/PGURLProtocol.h&gt;
      #import &lt;PhoneGap/Reachability.h&gt;
  #else
      #import "PGPlugin.h"
      #import "PGURLProtocol.h"
      #import "Reachability.h"
  
  #endif
  
  @implementation AppDelegate
  @synthesize invokeString, window, viewController;
  
  - (void) reachabilityChanged:(NSNotification *)notice
  {
  
      NSLog(@"???????? CODE NEVER GETS HERE ??????????");
  
      Reachability *reach = [notice object];
      NSParameterAssert([reach isKindOfClass: [Reachability class]]);
      NetworkStatus remoteHostStatus = [reach currentReachabilityStatus];
  
      if(remoteHostStatus == NotReachable) {NSLog(@"**** Not Reachable ****");}
      else if (remoteHostStatus == ReachableViaWiFi) {NSLog(@"**** wifi ****"); }
      else if (remoteHostStatus == ReachableViaWWAN) {NSLog(@"**** cell ****"); }
  }
  
  - (BOOL) application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
  {    
  
      [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reachabilityChanged:) name:kReachabilityChangedNotification object:nil];
  
      Reachability *reach = [Reachability reachabilityForInternetConnection];
      [reach startNotifier];
  
      NetworkStatus remoteHostStatus = [reach currentReachabilityStatus];
  
      NSLog(@”???? ALWAYS INITS WITH Not Reachable ????”);
      if(remoteHostStatus == NotReachable) {NSLog(@"init **** Not Reachable ****");}
      else if (remoteHostStatus == ReachableViaWiFi) {NSLog(@"int **** wifi ****"); }
      else if (remoteHostStatus == ReachableViaWWAN) {NSLog(@"init **** cell ****"); }
  
      // ...
  
  }
  
  @end
  </code></pre>