Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #import "Reachability.h"
- - (id) init {
- ...
- self.internetReachable = [Reachability reachabilityForInternetConnection];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(checkNetworkStatus) name:kReachabilityChangedNotification object:nil];
- [self.internetReachable startNotifier];
- ...
- }
- - (void) dealloc
- {
- [self.internetReachable stopNotifier];
- [[NSNotificationCenter defaultCenter] removeObserver:self];
- }
- NSCAssert([(NSObject*) info isKindOfClass: [Reachability class]], @"info was wrong class in ReachabilityCallback");
- - (void)dealloc
- { // self.hostReachability is my property holding my Reachability instance
- if (self.hostReachability) {
- [self.hostReachability stopNotifier];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement