iOS的plist文件适配那点事儿
2016-11-17 本文已影响89人
爱吃鱼的小灰
关于AFNetworking的网络请求失败看这里
- 网络请求失败首先考虑一点有没有在plist文件里适配http协议,也就是看你的plist文件里有没有下边的代码:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
iOS10也有一些需要适配的plist文件内容
- 当你碰到一下报错:
This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.
This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSMicrophoneUsageDescription key with a string value explaining to the user how the app uses this data.
This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.
- 对应的解决是缺少哪个就在plist文件加入哪个
// 这个是相机的
<key>NSCameraUsageDescription</key>
<string>cameraDesciption</string>
// 通讯录
<key>NSContactsUsageDescription</key>
<string>contactsDesciption</string>
// 相册
<key>NSMicrophoneUsageDescription</key>
<string>microphoneDesciption</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>此 App 需要您的同意才能读取媒体资料库</string>
- 我了解到的就这么多了,欢迎大家指正。