locationServicesEnabled always return YES

testing picture testing · Oct 27, 2010 · Viewed 7.9k times · Source

I tested my device (iPod Touch 2G iOS 4.1) if location services are enabled

permitted = [locationManager locationServicesEnabled];

and I always get a YES whether location services are enabled or not. I'm talking about the general button for location services and not the app specific button. On iPad with iOS 3.2.2 everything is working fine.

Answer

Pascalius picture Pascalius · Mar 1, 2011

Remember that [locationManager locationServicesEnabled] is deprecated since iOS 4.0. Use the Class Method [CLLocationManager locationServicesEnabled] instead.

The App Specific Button can be retrieved by

[CLLocationManager authorizationStatus]