NSLocationWhenInUseUsageDescription警告,但我已经添加了它 [英] NSLocationWhenInUseUsageDescription warning, but I have already added it

查看:137
本文介绍了NSLocationWhenInUseUsageDescription警告,但我已经添加了它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经添加了:

NSLocationWhenInUseUsesDescription

NSLocationWhenInUseUsageDescription

我一直收到此警告:

此应用已尝试访问对隐私敏感的数据,但没有使用说明.该应用程序的Info.plist必须包含一个NSLocationWhenInUseUsageDescription键,该键具有字符串值,向用户解释该应用程序如何使用此数据

This app has attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSLocationWhenInUseUsageDescription key with a string value explaining to the user how the app uses this data

仅供参考:我在应用中有多个Info.plist.不知道该怎么办.

FYI: I have multiple Info.plist in the app. Not sure what to do.

推荐答案

我正在

viewDidLoad

viewDidLoad

如下:

self.locationManager.requestWhenInUseAuthorization()

当我删除此行时,错误消失了.

when I removed this line the error disappeared.

这篇关于NSLocationWhenInUseUsageDescription警告,但我已经添加了它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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