【发布时间】:2016-02-17 23:59:30
【问题描述】:
我得到操作无法完成。 (kCLErrorDomain 错误 0。)当我运行下面的代码时。我尝试使用 [self.locationManager startUpdatingLocation] 启动 CLLocationManager;但这给出了 startUpdatingLocation 在 watchOS 中不可用的错误。
self.locationManager = [CLLocationManager new];
self.locationManager.delegate = self;
self.locationManager.desiredAccuracy = kCLLocationAccuracyBest;
[self.locationManager requestWhenInUseAuthorization];
[self.locationManager requestLocation];
- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations {
}
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error {
}
【问题讨论】:
-
在我发这篇文章之前,我经历了所有这些。这不是答案。
标签: iphone cllocationmanager watchkit apple-watch