您的位置:首页 > 大数据 > 人工智能

错误: Error Domain=kCLErrorDomain,The operation couldn’t be completed

2016-04-12 17:15 393 查看

错误

在模拟器上调试发现获取位置坐标信息的时候会报错,错误信息: 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

方案二

在模拟器的 debug -> location 中选择 None, 然后再重新改回 Custom Location 并给定好坐标, 这个方法就省时省力了, 不用频繁的重启模拟器了.

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: