Хм .. Я не думал использовать authorizationStatus
или locationServicesEnabled
. Я сделал следующее:
MKUserLocation *userLocation = mapView.userLocation;
if (!userLocation.location) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Location Service Disabled"
message:@"To re-enable, please go to Settings and turn on Location Service for this app."
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
[alert release];
return;
}
Я рад, что есть лучший способ проверки, но у меня не было проблем с тем, как я могу определить, разрешено ли моему приложению использовать GPS.
Надеюсь, это поможет!