The perfect solution to the permission crash problem of ios10 adaptation

After upgrading IOS 10, there are still a lot of visual pits. Record it and see if it will become a series.

Let's get to the point

Today, I was writing a project related to swift 3. After a little practice, I found that I called the camera and broke down. Try calling the album. It's broken again. Then you can see that the console outputs the following information:

This app has 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.

That means you need to be in info Plist file, add a key of nsphotolibrayusagedescription, and then add a description.

Solution

1. Find info. In the project Plist file, right-click to open 2 in the form of source code Add the following key value pairs, taking photolibrary as an example

Note that the key must not be written wrong, and the value is < string > < / String > you can write it at will

Visually check that all the required permission descriptions will crash in IOS 10 beta. Don't be afraid. The console will output them. Just add them yourself. I'll send you some key / values

Well, then clean it and run it again.

Of course, I prefer to directly info Plist is still in the form of property list, and then click add, that is, slide to the last item, and a small plus sign will appear. Enter privacy to quickly locate this permission series, find the permission you need, and modify the following value

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>