Localizing the user on iOS 8

南笙酒味 提交于 2019-12-08 20:13:58

问题


Hullo, I am starting to port my apps to iOS 8 and I soon bounced into a problem with CLLocationManager. Basically the app no longer centers the map on the user's location and instead proposed error:

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

Executing

 [CLLocationManager requestAlwaysAuthorization]

does nothing and even inserting the NSLocationAlwaysUsageDescription key in the app’s Info.plist changes nearly nothing. In fact the only apparent effect of the operation is the location setting in the preferences that, upon running the app, has its value reset from the value I had entered.


回答1:


I added the two lines to my plist (see below), and furthermore i call [locationManager requestWhenInUseAuthorization]; first line in my viewDidLoad:..

Do you have any suggestions? =)




回答2:


I was having the same problem. I had edited the XXXTest-Info.plist file instead of XXXInfo.plist file. Now I got it working, with little less hair on my head.




回答3:


in the string the keys write YES it will look like Application requires iPhone enviroment YES



来源:https://stackoverflow.com/questions/24082188/localizing-the-user-on-ios-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!