The location service indicator in the status bar still appears even after an explicit call to stopUpdatingLocation in the CLLocationManager

I have a view that says map view. I used CLLocationManager to get the current location and show on the map. Then, when the view is closed, I do the following

_mapView.delegate = nil; _mapView = nil; [_locationManager stopUpdatingLocation]; _locationManager.delegate = nil; _locationManager = nil; 

However, the location service indicator (GPS) in the status bar is still unchanged. And when the application goes into the background and then back to the fore, it will wait until the indicator appears on the status bar before it is active.

Is there a reason the indicator still exists?

EDIT - the following: CLLocationManager is initialized and launched

  if (_locationManager == nil) { _locationManager = [[CLLocationManager alloc] init]; _locationManager.delegate = self; _locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation; _locationManager.distanceFilter = kCLDistanceFilterNone; [_locationManager startUpdatingLocation]; } 

and that's how I stopped him

  if (_locationManager != nil) { [_locationManager stopUpdatingLocation]; _locationManager.delegate = nil; _locationManager = nil; } 
+4
source share
2 answers

As explained by WWDC's deployment engineers, the icon stays in the upper right corner for a certain amount of time, depending on which service was last used. I believe that after stopping the use of the [locationManager stopUpdatingLocation] timer will start until the icon disappears. Longer for some services. They did not go into details about how long these timers were. I know that they are going to get more in iOS 6.

Once you stop tracking location, just wait for it (30-60 seconds) and see if the icon is dropping. This should suggest that you have everything stopped. Hope this helps.

+2
source

I had a similar problem and found the answer here:

What determines if the iPhone Location Services icon is in the status bar?

The solution in my case (in development) was to reset location alerts (Settings> General> reset> reset Location alerts)

+1
source

All Articles