After upgrading IOS 10, there are still a lot of visual pits, record it and see if it will be a series.
Go straight to the chase.
Today, using a small project to practice, found to call the camera, collapsed. Try to call the album, but also special collapse. Then see the console output the following information:
This app had crashed because it attempted 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 means that you need to add a key to the Info.plist file NSPhotoLibraryUsageDescription , and then add a description.
Solution Solutions
1. Locate the file in the project info.plist and right-click to Source Code open it
2. Add the following key-value pairs, with photolibrary as an example
<key>NSPhotoLibraryUsageDescription</key><string> this App requires your consent to read the Media Library </string>
Note that key is absolutely not written wrong,
and value is <string></string> you can write it
Visual inspection of all required permission description will be in IOS beta inside crash, do not fear, console will have output, self-added on OK, I also have a few key/value to you
<key>NSCameraUsageDescription</key> <string>cameraDesciption</string><key> Nscontactsusagedescription</key> <string>contactsDesciption</string><key> Nsmicrophoneusagedescription</key> <string>microphoneDesciption</string>
Of course, my preferred approach is to directly
info.plistOr use Property List the form, then click Add, or swipe to the last item to appear with a small plus sign
Input Privacy can quickly locate this permission series, find the permissions you need, modify the following value to
This article references: http://www.jianshu.com/p/c212cde86877
IOS 10 Development Adaptation series permissions crash problem