Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Notification is not being called in Reachability

I have used Andrew's modified Reachability class.

-(void)viewDidLoad

[[NSNotificationCenter defaultCenter] postNotificationName:kReachabilityChangedNotification object:nil];
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(checkNetworkStatus:) name:kReachabilityChangedNotification object:nil];

When data is downloading I turn AirPort off. But checkNetworkStatus is not being called. Am I missing something. Please help me. This problem driving me nuts. Thanks in advance.

like image 842
Harsh Avatar asked Jul 28 '11 13:07

Harsh


1 Answers

Did you tell the reachability instance to start broadcasting notifications?

Reachability *internetReachable = [Reachability reachabilityForInternetConnection];
// This will tell the notifier to start sending notifications
[internetReachable startNotifier];
like image 174
rckoenes Avatar answered Oct 02 '22 15:10

rckoenes