You’re making this more difficult than it needs to be. Try this:
- (void)viewDidLoad {
[super viewDidLoad];
[[AFNetworkReachabilityManager sharedManager] startMonitoring];
}
- (BOOL)connected {
return [AFNetworkReachabilityManager sharedManager].reachable;
}
If you also want to be notified when the status changes, then implement setReachabilityStatusChangeBlock
.