Skip to content

Instantly share code, notes, and snippets.

@sneakyness
Created September 1, 2011 17:36
Show Gist options
  • Save sneakyness/1186726 to your computer and use it in GitHub Desktop.
Save sneakyness/1186726 to your computer and use it in GitHub Desktop.
iOS 3/4 compatible locationServices check
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