我正在尝试在iOS 8上使用MapKit,但是一直出现错误:
Trying to start MapKit location updates without prompting for location authorization. Must call
-[CLLocationManager requestWhenInUseAuthorization] or -[CLLocationManager
requestAlwaysAuthorization] first.
在这里查找,我发现我需要在我的plist中实现
NSLocationWhenInUsageDescription
并调用locationManager.requestWhenInUseAuthorization()
。但是什么也没有发生,我仍然在控制台中得到那个错误。我做错了什么?
NSLocationWhenInUsageDescription
是错误的键。请使用NSLocationWhenInUseUsageDescription
。 - Klaas