I also got the Wifi flag, even if it was disabled. There is an error in the Reachability.m method:
- (NetworkStatus)networkStatusForFlags:(SCNetworkReachabilityFlags)flags
it uses BOOL as the return value, but assigns it a structure value with three values:
typedef enum : NSInteger { NotReachable = 0, ReachableViaWiFi, ReachableViaWWAN } NetworkStatus;
So, if Wi-Fi or Cellular is available, it will be ReachableViaWiFi (since BOOL can be 0 or 1, but not two)
To fix this, simply change the method above this:
BOOL returnValue = NotReachable;
For this:
int returnValue = NotReachable;
And you are good to go. Hope this helps.
Jordan
source share