AFNetworkReachabilityManager says no network

afnetworking-2, ios7

Solution

I know it's too late to answer. If anybody looking for this.

Determining network status requires little time. So, calling isReachable right after startMonitoring will always return false.

You can call isReachable inside setReachabilityStatusChangeBlock ;

    [[AFNetworkReachabilityManager sharedManager] startMonitoring];
    [[AFNetworkReachabilityManager sharedManager] setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status){
          NSLog(@"status changed");
         //check for isReachable here
    }];

Problem

I'm confused due to lack of examples, so I did this in my appDelegate's didFinishLaunching: ``` [[AFNetworkReachabilityManager sharedManager] startMonitoring]; bool isThere = [[AFNetworkReachabilityManager sharedManager] isReachable]; ``` And that always returns false, in spite of the network being there and working. Two questions: 1) if I'm not looking for changes in status, do I need startMonitoring? 2) is there anything you need to do before reading isReachable? Do you need to wait?

Original source