Search code examples
iphoneobjective-ciosreachability

Reachability startNotifier - does it require phone resources


I have to check internet connection sometimes and use "Reachability" for this purpose.

Would be better to manually checking internet connection using "Reachability" like:

BOOL status = ([[Reachability reachabilityForInternetConnection] currentReachabilityStatus] != NotReachable);

Or use Reachability notifications and

//Start listening for reachability notifications on the current run loop
- (BOOL) startNotifier;

Do notifications require some phone recources like battery etc, and will I get some problems if I don't use "stopNotifier"?

Thanks


Solution

  • It's very simple:

    • Use the singleton if you need to check whether you have an internet connection or not at a certain point in time
    • Use the notifier + notifications if you need to keep track of changes in internet connectivity over a certain period of time