I need to restart a download automatically when a connection goes down and then comes back up. Actually I'm using the Reachability class example from Apple but I have a problem when the switch down and up wi-fi application restarts the download, but this does not happen if I have wi-fi but not an internet connection. To do this I check connection and I register method to notification but this notification is never fired.
hostReach = [NaviReachability reachabilityWithHostName:@"www.apple.com"]; internetReach = [NaviReachability reachabilityForInternetConnection]; wifireach = [NaviReachability reachabilityForLocalWiFi]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(resumeDownloadOnNotification:) name:@"kNetworkReachabilityChangedNotification" object:nil];
[hostReach startNotifer]; [internetReach startNotifer]; [wifireach startNotifer]; Blockquote
I noticed that if my application makes a connection (or iphone receives or sends something from internet) the notification arrives, and the method is executed.
Do any of you have any suggestions?