iOS 10访问相机Crash,plist权限设置

在iOS 10的上访问相机Crash,打印出以下错误信息
错误信息:This app has crashed because it attempted 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.
原因:iOS 10的权限问题
解决:在 info.plist文件中添加相应的key和value
这里写图片描述
也可右键点击以 Source Code形式打开,添加如下:

       <key>NSPhotoLibraryUsageDescriptionkey>
<string>请点击“允许”以允许访问。string>
<key>NSCameraUsageDescriptionkey>
<string>请点击“允许”以允许访问。string>
<key>NSAppleMusicUsageDescriptionkey>
<string>请点击“允许”以允许访问。string>
<key>NSMicrophoneUsageDescriptionkey>
        <string>请点击“允许”以允许访问。string>

附可能涉及到的权限:
iOS 10访问相机Crash,plist权限设置_第1张图片

你可能感兴趣的:(iOS_应用)