Hi,
The sample provided by Apple checks for three kind of reachability check:
1. Remote Host Reachability
2. Internet Reachability
3. Wi-Fi Reachability
For remote host reachability check, you need to provide host address. But for Internet / Wi-Fi reachability check, there is no need to provide host address. I think in your case, you only need to check for the internet reachability.
If you have downloaded the Sample provided by Apple, go to the viewDidLoad method of APLViewController.m class. You can just replace the viewDidLoad method with the following:
- (void)viewDidLoad
{
self.summaryLabel.hidden = YES;
/*
Observe the kNetworkReachabilityChangedNotification. When that notification is posted, the method reachabilityChanged will be called.
*/
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reachabilityChanged:) name:kReachabilityChangedNotification object:nil];
self.internetReachability = [Reachability reachabilityForInternetConnection];
[self.internetReachability startNotifier];
[self updateInterfaceWithReachability:self.internetReachability];
}
Then run the sample, you will see the 2nd option in the Simulator/ device will show you the current internet status. Same thing you can implement in your application.
I hope it will solve the problem.
Thanks.