Created
February 13, 2014 02:28
-
-
Save kharmabum/8968673 to your computer and use it in GitHub Desktop.
Check whether locationServices are enabled.
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
if ((![CLLocationManager locationServicesEnabled]) | |
|| ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusRestricted) | |
|| ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusDenied)) { | |
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error", nil) message:NSLocalizedString(@"Location services must be enabled in Settings.", nil) delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; | |
[alertView show]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment