次のように試してください:
あなたの宣言で:
@property (nonatomic) Reachability *reachability;
実装:
- (void)viewDidLoad {
[super viewDidLoad];
self.reachability = [Reachability reachabilityForInternetConnection];
[self.reachability startNotifier];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleNetworkChange:)
name:kReachabilityChangedNotification
object:nil];
}
- (void)handleNetworkChange:(NSNotification *)notice {
NetworkStatus remoteHostStatus = [self.reachability currentReachabilityStatus];
if(remoteHostStatus == NotReachable)
{
}
else if (remoteHostStatus == ReachableViaWiFi)
{
}
else if (remoteHostStatus == ReachableViaWWAN)
{
}
}