iOS CLLocationManager
报告didFailWithError
方法中的各种错误:
https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CoreLocationConstantsRef/Reference/reference.html#//apple_ref/c/econst/kCLErrorDenied
在文档中,不清楚哪些错误(kCLErrorDenied
和kCLErrorLocationUnknown
除外)会停止位置管理器和位置更新?
此致
答案 0 :(得分:0)
尝试打印错误对象说明。你会知道失败的原因是什么。可能的原因可能是您未授予对应用使用位置的权限,也未手动撤销使用位置。
如果您在模拟器中失败,请确保模拟器指向某个自定义位置。