可达性是实时更新(reachabilityWithHostName)?

时间:2012-11-04 13:58:42

标签: iphone objective-c ios xcode

  

可能重复:
  reachabilityWithHostName Example

我有这段代码:

[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(reachabilityChanged:) name: kReachabilityChangedNotification object: nil];
hostReach = [Reachability reachabilityWithHostName: @"www.apple.com"];
[hostReach startNotifier];    

- (void) reachabilityChanged: (NSNotification* )note{
Reachability* curReach = [note object];
NSParameterAssert([curReach isKindOfClass: [Reachability class]]);
}

我的问题是: 如果www.apple.com不会响应某些resone,则会自动调用reachabilityChanged函数吗?

0 个答案:

没有答案