【问题标题】:Location Manger Error: The operation couldn’t be completed. (kCLErrorDomain error 0.)位置管理器错误:操作无法完成。 (kCLErrorDomain 错误 0。)
【发布时间】:2016-10-22 12:38:25
【问题描述】:

在设备中运行我的代码时,我无法获取设备的当前位置。

-(void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error 

方法调用。设备移动时我无法获取设备位置。

【问题讨论】:

标签: ios objective-c iphone core-location cllocationmanager


【解决方案1】:

1.您必须设置默认位置:

Debug -> Location

2.您必须使用

清除所有数据
 "iOS Simulator" -> "Reset Content and
  Settings....

3.

然后清理项目并运行项目..我希望它会工作..:)

【讨论】:

    【解决方案2】:

    在 iOS 8 中,默认情况下,位置服务对您创建的新应用程序禁用。因此,要启用它,请转到设置->隐私->位置服务并从中选择您的应用程序,并在允许位置服务下使其“始终” . 谢谢

    【讨论】:

      猜你喜欢
      • 2010-11-27
      • 2017-01-22
      • 2015-06-03
      • 2013-10-21
      • 2014-03-04
      • 2011-08-27
      • 2018-10-24
      • 1970-01-01
      • 2010-11-24
      相关资源
      最近更新 更多