【发布时间】:2017-09-20 06:00:29
【问题描述】:
我刚刚更新到 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 中添加以下键:
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>This app needs your current location</string>
但是当我再次尝试运行该应用程序时,Xcode 9 会显示一条警告:无法读取数据,因为它的格式不正确。
所以我切换回:
<key>NSLocationAlwaysUsageDescription</key>
该应用程序运行良好。哦,我的 Info.plist 已经包含 NSLocationWhenInUseUsageDescription 键!
这是控制台中的 Xcode 9 错误吗?有人收到同样的警告吗?
【问题讨论】:
标签: ios swift location ios11 xcode9