I am trying Tony's Reachability
, below is the standard sample code:
Reachability* reach = [Reachability reachabilityWithHostname:@"www.google.com"];
reach.reachableBlock = ^(Reachability*reach)
{
dispatch_async(dispatch_get_main_queue(), ^{
NSLog(@"reachable!");
});
};
reach.unreachableBlock = ^(Reachability*reach)
{
dispatch_async(dispatch_get_main_queue(), ^{
NSLog(@"unreachable!");
});
};
[reach startNotifier];
I am using emulator and tried to turn off mac's wifi, it prints the unreachable, then turns on mac's wifi but it intermittently doesn't print the reachable, in condition: application is still in use (foreground).
Is there any way to solve this?