locationManager无法在iOS 9上运行 [英] locationManager not working on iOS 9
问题描述
我的GPS位置刷新信息有问题.单击按钮时,由我"locationManager"提供的功能不会刷新标签"中的信息.
I have a problem with the refresh information on your GPS position. The function given by me "locationManager" when you click the button does not refresh the information in the "Label".
我的代码: http://pastebin.com/hWeq6gTS
我是iOS的新手程序员.请帮忙.
I am a novice programmer iOS. Please help.
推荐答案
定位服务并不总是显而易见的问题是,您必须在Info.plist中具有以下两个键之一:
The issue that is not always obvious with the location services is that you have to have one of these two keys in your Info.plist:
-
NSLocationWhenInUseUsageDescription
-
NSLocationAlwaysUsageDescription
然后,在开始更新职位时,不要忘记首先请求权限(再次取决于您的要求(使用中/始终)):
Then, when starting updating of your position, don't forget to request permissions first (again, depending on your requirements (when in use/always):
-
[self.locationManager requestWhenInUseAuthorization]
-
[self.locationManager requestAlwaysAuthorization]
这篇关于locationManager无法在iOS 9上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!