난 당신이 행동을 무시할 수 있다고 생각하지 않습니다 수 있도록 전년도 이 경고. 그러나 CLLocationManager의 대리자 메서드를 구현할 수 있습니다.
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error;
사용자가 앱의 위치 서비스를 사용 설정했는지 여부를 확인할 수 있습니다. 여기
은 상기 방법
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error {
[self.locationManager stopUpdatingLocation];
switch([error code]) {
case kCLErrorDenied:
//User has not enabled location services for this app.
break;
case kCLErrorLocationUnknown:
//location could not be found
break;
default:
//some other issue
break;
}
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"An error title"
message:@"An error message"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
}
의 구현의 예