iOS10出了以后淀歇,第一時(shí)間升級(jí)了Xcode困鸥,發(fā)現(xiàn)了一些問題借帘。
1.選擇頭像洋措,調(diào)用相冊(cè)的時(shí)候崩潰了济蝉。
打出來以后日志:
This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app’s Info.plist must contain an key with a string value explaining to the user how the app uses this data.
從這段話可以看出只要在info.plist加入一個(gè)key就可以解決,值的話隨意下菠发,調(diào)用時(shí)的一個(gè)提示王滤。
在info.plist 中添加一個(gè)key: Privacy - Photo Library Usage Description
后邊的內(nèi)容填寫友好提示,如:請(qǐng)同意獲取您的多媒體資料等
這里寫圖片描述aster/plis.png)
其它的權(quán)限key:
// 相機(jī)
NSCameraUsageDescription
// 相冊(cè)
NSPhotoLibraryUsageDescription
// 麥克風(fēng):
NSMicrophoneUsageDescription
// 通信錄
NSContactsUsageDescription
// 位置
NSLocationUsageDescription
// 日歷
NSCalendarsUsageDescription
// 藍(lán)牙
NSBluetoothPeripheralUsageDescription
// 媒體資料庫
NSAppleMusicUsageDescription
// 提醒事項(xiàng)
NSRemindersUsageDescription
// 在使用期間訪問位置
NSLocationWhenInUseUsageDescription
// 始終訪問位置
NSLocationAlwaysUsageDescription
// 運(yùn)動(dòng)與健身
NSMotionUsageDescription
2.打印的時(shí)候出來很多無用的東西
只要在Edit Scheme - run中添加OS_ACTIVITY_MODE =disable即可