Reputation: 726
i read the https://developer.apple.com/library/ios/#samplecode/Reachability/Introduction/Intro.html my Question is if the www.apple.com is become not active Suddenly..this code will alert me? or just if my connection fail's?
Upvotes: 1
Views: 2067
Reputation: 38475
That's absolutely right.
It will fire off a kReachabilityChangedNotification
notification that tells you the new reachability state.
You get the new reachability state something like this :
- (void)reachabilityChanged:(NSNotification *)notification {
Reachability *reachability = notification.object;
if (NotReachable == reachability.currentReachabilityStatus)
NSLog(@"No longer reachable");
}
Upvotes: 3