Canopus Canopus - 1 year ago 124
iOS Question

why self.locationManager stopUpdatingLocation doesn't stop location update

Problem: It seems I can't stop

Core Location
from sending updates to my app / tracking.

What am I doing: In my
I call
and pass it to a method to show user's location on the map (an instance of
). The getter is overridden to check for availability of the serive, to see whether its authorized. If so, it

, I call
[self.locationManager stopUpdatingLocation]
. But still I can see the location icon in the status bar. Even when I terminate the app by double tapping the home button and closing it, the icon is still there... even after extended amount of time (10+ minutes). When I go to the Settings App, it tells me that my app is still using location services (purple icon).

Question: What am I missing here? Why location update doesn't stop?

Thanks in advance.

Answer Source

The opposite of startMonitoringSignificantLocationChanges is not stopUpdatingLocation, it is stopMonitoringSignificantLocationChanges.

You probably want to replace startMonitoringSignificantLocationChanges with startUpdatingLocation for the sake of more regular updates, unless you have a specific reason for monitoring only for significant location changes.

Check out the CLLocation documentation for further detail.