我嘗試使用新的iOS的遞延位置更新6的功能,但不斷收到此錯誤:如何使用延期位置iOS 6?
didFinishDeferredUpdatesWithError:錯誤域= kCLErrorDomain碼= 11「的操作無法完成(kCLErrorDomain錯誤。 11)」
我使用下面的代碼:
- (DeviceAPI *) init
{
locationManager = [[CLLocationManager alloc] init];
[locationManager setDelegate:self];
[locationManager setDesiredAccuracy:kCLLocationAccuracyBest];
[locationManager startUpdatingLocation];
[locationManager allowDeferredLocationUpdatesUntilTraveled:(CLLocationDistance)100000 timeout:(NSTimeInterval)100000];
return self;
}
這callback
功能:
- (void)locationManager: (CLLocationManager *) manager
didFinishDeferredUpdatesWithError:(NSError *)error
{
NSLog(@"didFinishDeferredUpdatesWithError :%@", [error description]);
}
任何幫助?
錯誤11'kCLErrorDomain'是'kCLErrorDeferredFailed'見文檔[這裏](HTTPS://開發商。 apple.com/library/mac/documentation/CoreLocation/Reference/CoreLocationConstantsRef/index.html#//apple_ref/c/tdef/CLError)。 – Pang
我發現這個尋找iOS 10 http://stackoverflow.com/questions/39498899/deferredlocationupdatesavailable-returns-no-in-ios-10 –