Created
August 14, 2012 03:23
-
-
Save piaoapiao/3346042 to your computer and use it in GitHub Desktop.
网络检测
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Reachability *hostReach = [[Reachability reachabilityWithHostName:@"http://www.baidu.com"] retain]; | |
[hostReach startNotifier]; | |
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(reachabilityChanged:) | |
name: kReachabilityChangedNotification object: nil]; | |
- (void) reachabilityChanged: (NSNotification*)note{ | |
NSLog(@"changed Net"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment