My app requires an internet connection, so in the ApplicationDelegate, on applicationDidFinishLaunching
I am running the following:
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(reachabilityChanged:) name: kReachabilityChangedNotification object: nil];
hostReach = [[Reachability reachabilityWithHostName: @"www.apple.com"] retain];
[hostReach startNotifer];
[self updateInterfaceWithReachability: hostReach];
But for some reason, this seems to be firing two times, since what gets logged is the following:
2010-02-04 14:25:48.004 myApp[201:207] Reachability Flag Status: -- ------- networkStatusForFlags
2010-02-04 14:25:48.240 myApp[201:207] STATUS: Access Not Available
2010-02-04 14:25:48.499 myApp[201:207] Reachability Flag Status: -- ------- networkStatusForFlags
2010-02-04 14:25:48.517 myApp[201:207] STATUS: Access Not Available
Which is good that it's working, but I have an alert message to notify the user that there is no connection, and it pops up twice...
Why is the reachability notifier firing two times?