3

So I'm using RestKit 0.20.0 and getting reachability changes via this block:

[objectManager.HTTPClient setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
    if (status == AFNetworkReachabilityStatusNotReachable) {
        self.isConnectedToInternet = NO;
    }
    else {
        self.isConnectedToInternet = YES;
    }
}];

I'm storing the state with a property called isConnectedToInternet, but this is only getting set when reachability changes. I don't see a method or property on the RKObjectManager or the AFNetworking version that RestKit uses in order to just get current reachability state, like this:

[AFNetworkReachabilityManager sharedManager].reachable

Any ideas?

codeman
  • 8,868
  • 13
  • 50
  • 79

1 Answers1

3

See

@property (readonly, nonatomic, assign) AFNetworkReachabilityStatus networkReachabilityStatus

On the AFHTTPClient.

Wain
  • 118,658
  • 15
  • 128
  • 151