title: Best way to implement RKReachabilityObserver in RestKit
body: <p>I have written a tab based application in Xcode/RestKit and am attempting to use the RKReachabilityObserver to determine Internet connectivity on the device.</p>
  
  <p>Ideally I'd like to have a single reachability variable throughout my application (if this is possible) but currently my implementation is as per the code below and does not work very well when replicated over my 4 tabs.</p>
  
  <p>If anybody has any suggestions of a better way to do this, I'd really appreciate your comments.</p>
  
  <p><strong>View.h</strong></p>
  
  <pre><code>@property (nonatomic, retain) RKReachabilityObserver *observer;
  </code></pre>
  
  <p><strong>View.m</strong></p>
  
  <pre><code>@interface AppViewController()
  {
      RKReachabilityObserver *_observer;
  }
  @property (nonatomic) BOOL networkIsAvailable;
  @synthesize observer = _observer;
  
  -(id)initWithCoder:(NSCoder *)aDecoder {
  
      if ((self = [super initWithCoder:aDecoder])) {
  
          self.observer = [[RKReachabilityObserver alloc] initWithHost:@"mydomain"];
          [[NSNotificationCenter defaultCenter] addObserver:self
                                                   selector:@selector(reachabilityChanged:)
                                                       name:RKReachabilityDidChangeNotification
                                                     object:_observer];
      }
      return self;
  }
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
  
      // determine network availability
      if (! [_observer isReachabilityDetermined]) {
          _networkIsAvailable = YES;
      }
      else
      {
          _networkIsAvailable = NO;
      }
  
      _text.returnKeyType = UIReturnKeyDone;
      _text.delegate = self;
  }
  
  - (void)reachabilityChanged:(NSNotification *)notification {
      RKReachabilityObserver* observer = (RKReachabilityObserver *) [notification object];
      if ([observer isNetworkReachable]) {
          if ([observer isConnectionRequired]) {
              _networkIsAvailable = YES;
              NSLog(@"Reachable");
              return;
          }
      } 
      else 
      {
          _networkIsAvailable = NO;
          NSLog(@"Not reachable");
      }
  }
  </code></pre>
  
  <p>then anywhere in my view, I simply do....</p>
  
  <pre><code>if (_networkIsAvailable == YES)
      {...
  </code></pre>
  
  <p>I have implemented this over multiple views (which seems to be causing the problem.</p>
  
  <p>What is the suggested approach for a multiple-view application?</p>