Created
September 1, 2011 17:36
-
-
Save sneakyness/1186726 to your computer and use it in GitHub Desktop.
iOS 3/4 compatible locationServices check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BOOL locationAccessAllowed = NO; | |
if( [CLLocationManager instancesRespondToSelector:@selector(locationServicesEnabled)] ) | |
{ | |
// iOS 3.x and earlier | |
locationAccessAllowed = locationManager.locationServicesEnabled ; | |
} | |
else if( [CLLocationManager respondsToSelector:@selector(locationServicesEnabled)] ) | |
{ | |
// iOS 4.x | |
locationAccessAllowed = [CLLocationManager locationServicesEnabled] ; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment