你好,
我开始将我的应用程序移植到 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 中的第一行:..
你有什么建议吗? =)
关于cllocationmanager - 在 iOS 8 上本地化用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24082188/