2014-10-13 3 views
0

다른 모든 사람들이 iOS8로 업그레이드 할 때와 마찬가지로 CLLocationManager 앱이 작동하지 않기 시작했습니다. 주제를 읽었고 수정 사항을 적용했다고 생각했지만 locationManager는 여전히 호출되지 않았습니다. 분명히 뭔가를 놓쳤습니다. ...업데이트 적용 후 iOS8 CLLocationManager가 작동하지 않음

#define IS_OS_8_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) 

- (void)viewDidLoad { 
    [super viewDidLoad]; 
    locationManager = [[CLLocationManager alloc] init]; 
    locationManager.desiredAccuracy = kCLLocationAccuracyBest; 
    locationManager.delegate = self; 
    locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters; 
    locationManager.distanceFilter = 10; 
    if(IS_OS_8_OR_LATER) { 
     [locationManager requestAlwaysAuthorization]; 
     NSLog(@"iOS8");   
    } 
    [locationManager startUpdatingLocation]; } 
+0

당신은 [에 StackOverflow에] 답을 찾을 수에 아주 좋은 설명이 있습니다 (http://stackoverflow.com/questions/24062509/ios-8-location-services-not-working) – Thorax

답변

0

또한 plist.info에 하나 또는 두 개의 문자열 항목을 추가해야합니다. 이것들이 없으면 어떤 오류도 발생하지 않을 것이고 그것은 단지 작동하지 않을 것입니다.

NSLocationWhenInUseUsageDescription 및 NSLocationAlwaysUsageDescription

을 그리고 헤이 프레스토 모든 작동합니다.

http://nevan.net/2014/09/core-location-manager-changes-in-ios-8/

관련 문제