我正在尝试使用新的iOS 6功能的自定义位置更新,但继续收到此错误:
didFinishDeferredUpdatesWithError:Error Domain = kCLErrorDomain Code = 11"无法完成操作.(kCLErrorDomain error 11.)"
我使用以下代码:
- (DeviceAPI *) init
{
locationManager = [[CLLocationManager alloc] init];
[locationManager setDelegate:self];
[locationManager setDesiredAccuracy:kCLLocationAccuracyBest];
[locationManager startUpdatingLocation];
[locationManager allowDeferredLocationUpdatesUntilTraveled:(CLLocationDistance)100000 timeout:(NSTimeInterval)100000];
return self;
}
Run Code Online (Sandbox Code Playgroud)
而这个callback功能:
- (void)locationManager: (CLLocationManager *) manager
didFinishDeferredUpdatesWithError:(NSError *)error
{
NSLog(@"didFinishDeferredUpdatesWithError :%@", [error description]);
}
Run Code Online (Sandbox Code Playgroud)
有帮助吗?