【问题标题】:CLLocationManager The operation couldn’t be completed and startUpdatingLocation not available on iwatchCLLocationManager 操作无法完成且 iwatch 上 startUpdatingLocation 不可用
【发布时间】: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


【解决方案1】:

我将我的项目方案设置为设置的默认位置,模拟器上的 iwatch 位置设置为无,iphone 模拟器位置设置为无。看起来计划和模拟器位置正在发生冲突。

【讨论】:

    猜你喜欢
    • 2012-07-26
    • 1970-01-01
    • 1970-01-01
    • 2016-05-30
    • 1970-01-01
    • 1970-01-01
    • 2014-11-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多