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

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

前几天解决了在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

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

原文地址:https://www.cnblogs.com/yaoliang11/p/4616734.html