位置管理器错误:操作无法完成。 (kCLErrorDomain错误0.)

问题描述:

将我的代码运行到设备中时,我无法获取设备当前位置。位置管理器错误:操作无法完成。 (kCLErrorDomain错误0.)

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

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

+2

可能重复:错误域= kCLErrorDomain代码=“操作无法完成0。 (kCLErrorDomain误差为0)“](http://*.com/questions/6032976/didfailwitherror-error-domain-kclerrordomain-code-0-the-operation-couldn-t-be) –

+0

你怎么能注册的位置经理? –

+0

请提供您的代码,以便我们可以帮助您。没有代码,我们无法找到任何解决方案。 – DJ1

在iOS系统中8 ownwards默认位置服务desabled一个新的应用程序,你create.So,使其能够进入设置 - >与隐私>定位服务,并从中选择您的应用程序,并使其“总是”下允许位置服务。 谢谢

你必须设置默认位置:

Debug -> Location 

2.您在使用

"iOS Simulator" -> "Reset Content and 
    Settings.... 

清除所有数据

然后清理项目和运行该项目..我希望它会工作.. :)的[didFailWithError