didFailWithError:Error Domain = kCLErrorDomain Code = 0"操作无法完成.(kCLErrorDomain error 0.)"on ios8 device NOT simulator

Na *_*oon 5 ipad ios8

我最初几次使用我的iOS8代码获得了正确的坐标,但是大约一分钟或几秒后我开始出现这个错误:

didFailWithError: Error Domain=kCLErrorDomain Code=0 "The operation couldn’t be completed. (kCLErrorDomain error 0.)"
Run Code Online (Sandbox Code Playgroud)

我在我的iPad上调试而不是我的模拟器.

有没有人有同样的问题?

    if(IS_OS_8_OR_LATER){
        NSUInteger code = [CLLocationManager authorizationStatus];
        if (code == kCLAuthorizationStatusNotDetermined && ([locationManager respondsToSelector:@selector(requestAlwaysAuthorization)] || [locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)])) {
            // choose one request according to your business.
            if([[NSBundle mainBundle] objectForInfoDictionaryKey:@"NSLocationAlwaysUsageDescription"]){
                [locationManager requestAlwaysAuthorization];
            } else if([[NSBundle mainBundle] objectForInfoDictionaryKey:@"NSLocationWhenInUseUsageDescription"]) {
                [locationManager  requestWhenInUseAuthorization];
            } else {
                NSLog(@"Info.plist does not contain NSLocationAlwaysUsageDescription or NSLocationWhenInUseUsageDescription");
            }
        }
        [locationManager startUpdatingLocation];
}

    - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
    {
    NSLog(@"didUpdateToLocation: %@", newLocation);
    CLLocation *currentLocation = newLocation;

    if (currentLocation != nil) {
        currX = [NSString stringWithFormat:@"%.8f", currentLocation.coordinate.longitude];
        currY = [NSString stringWithFormat:@"%.8f", currentLocation.coordinate.latitude];

    }
}
Run Code Online (Sandbox Code Playgroud)