热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Xcode9-Info.plist中的位置使用说明-iOS11

如何解决《Xcode9-Info.plist中的位置使用说明-iOS11》经验,为你挑选了1个好方法。

我刚刚更新到Xcode 9.0正式版,当我运行使用位置服务的应用程序时,它工作正常但控制台打印出以下警告:

The app's Info.plist must contain both NSLocationAlwaysAndWhenInUseUsageDescription and NSLocationWhenInUseUsageDescription keys with string values explaining to the user how the app uses this data

所以我试图在我的Info.plist中添加以下密钥:

 NSLocationAlwaysAndWhenInUseUsageDescription
    This app needs your current location

但是当我再次尝试运行应用时,Xcode 9会显示一条警告:无法读取数据,因为数据格式不正确.

所以我切换回:

NSLocationAlwaysUsageDescription

该应用程序工作正常.哦,我的Info.plist已经包含了NSLocationWhenInUseUsageDescription键!

这是控制台中的Xcode 9错误吗?有人得到同样的警告吗?



1> xscoder..:

没关系,我通过简单地浏览和选择Info.plist中的正确隐私 - 位置使用选项- >打开为 - >属性列表视图来修复它,这里是在需要时插入Info.plist的正确键:

NSLocationAlwaysAndWhenInUseUsageDescription
This app needs your current location

NSLocationWhenInUseUsageDescription
This app needs your current location


推荐阅读
author-avatar
百万会员XTN_859
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有