You should probably be using +[Reachability reachabilityForInternetConnection] rather than reachability for a particular name (unless of course that's what you actually need).
There could be all manner of reasons that a particular server might not be reachable while you still have a working internet connection, after all.
This is what I do:
BOOL hasInet;
Reachability *connectionMonitor = [Reachability reachabilityForInternetConnection];
[[NSNotificationCenter defaultCenter]
addObserver: self
selector: @selector(inetAvailabilityChanged:)
name: kReachabilityChangedNotification
object: connectionMonitor];
hasInet = [connectionMonitor currentReachabilityStatus] != NotReachable;
and then
-(void)inetAvailabilityChanged:(NSNotification *)notice {
Reachability *r = (Reachability *)[notice object];
hasInet = [r currentReachabilityStatus] != NotReachable;
}
which works nicely for me.
Frank Shearar
2010-04-19 07:59:42