作者:萌新求学 | 来源:互联网 | 2022-12-21 18:31
ImtryingtouseMapKitoniOS8andIkeepgettingtheerror:我正在尝试在iOS8上使用MapKit并且我不断收到错误:Try
I'm trying to use MapKit on iOS 8 and I keep getting the error:
我正在尝试在iOS 8上使用MapKit并且我不断收到错误:
Trying to start MapKit location updates without prompting for location authorization. Must call
-[CLLocationManager requestWhenInUseAuthorization] or -[CLLocationManager
requestAlwaysAuthorization] first.
Looking it up here, I found that I had to implement NSLocationWhenInUsageDescription
in my plist and also make a call to locationManager.requestWhenInUseAuthorization()
but nothing happens and I still get that error in the console. What am I doing wrong?
在这里查看,我发现我必须在我的plist中实现NSLocationWhenInUsageDescription,并且还调用了locationManager.requestWhenInUseAuthorization(),但没有任何反应,我仍然在控制台中得到该错误。我究竟做错了什么?
3 个解决方案