locationManager无法在iOS 9上运行 [英] locationManager not working on iOS 9

查看:60
本文介绍了locationManager无法在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:

  1. NSLocationWhenInUseUsageDescription
  2. NSLocationAlwaysUsageDescription

然后,在开始更新职位时,不要忘记首先请求权限(再次取决于您的要求(使用中/始终)):

Then, when starting updating of your position, don't forget to request permissions first (again, depending on your requirements (when in use/always):

  1. [self.locationManager requestWhenInUseAuthorization]
  2. [self.locationManager requestAlwaysAuthorization]

这篇关于locationManager无法在iOS 9上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆