IOS8解决获取位置坐标信息出错(Error Domain=kCLErrorDomain Code=0)

来源:互联网 发布:网络小贷牌照名单 编辑:程序博客网 时间:2024/04/28 01:15

前几天解决了在ios8上无法使用地址位置服务的问题,最近在模拟器上调试发现获取位置坐标信息的时候会报错,错误信息: didFailWithError: Error Domain=kCLErrorDomain Code=0 “The operation couldn’t be completed. (kCLErrorDomain error 0.)”。

出错原因是xcode里面的project–>scheme–>edit scheme–>options–>core location–>allow location simulation配置错误;如下图:

这里写图片描述

解决办法:

  1. 若已经设置了,取消勾选,保存;

  2. 将simulator–>reset content and settings:

  3. 再重新勾选allow location simulation,

  4. 再reset content and settings

这样应该就可以解决该问题了。

0 0