cllocationmanager - 在 iOS 8 上本地化用户

标签 cllocationmanager ios8

你好,
我开始将我的应用程序移植到 iOS 8,但很快我就遇到了 CLLocationManager 的问题。基本上,该应用程序不再将 map 以用户的位置为中心,而是提出了错误:

Trying to start MapKit location updates without prompting for location authorization. Must call -[CLLocationManager requestWhenInUseAuthorization] or -[CLLocationManager requestAlwaysAuthorization] first.



执行
 [CLLocationManager requestAlwaysAuthorization]

什么都不做,甚至插入NSLocationAlwaysUsageDescription应用程序的 Info.plist 中的键几乎没有任何变化。
事实上,该操作唯一明显的效果是首选项中的位置设置,在运行应用程序时,它的值从我输入的值中重置。

最佳答案

我将这两行添加到我的 plist(见下文),此外我调用 [locationManager requestWhenInUseAuthorization];我的 viewDidLoad 中的第一行:..

你有什么建议吗? =)

enter image description here

关于cllocationmanager - 在 iOS 8 上本地化用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24082188/

相关文章:

objective-c - 在 iOS 8(Xcode 6) 中使用未声明的标识符 'GL_BGRA_EXT' 错误?

ios - Apple 告诉 iOS8 上扩展的 64 位要求是什么意思?

swift - 应用程序不更新我的位置

ios,startMonitoringSignificantLocationChanges - 有时会中断监控

ios - iPhone 启动画面作为一个简短的 mp4 视频 swift ios

xcode - Storyboard预览与 xCode 6 中的模拟器或设备不匹配

ios - UIPopoverPresentationController 不调用 UIAdaptivePresentationControllerDelegate 方法

ios - 如何在 iOS 模拟器中禁用系统位置警报

ios - CLLocationManager - kCLErrorDomain

ios - 等待完成异步进程以获取 iOS 应用程序中的当前位置