今天剛升級到Xcode8,先運行項目跑了一下,果不其然蘋果又偷偷修改東西了,在網上查了一下,蘋果強制要求APP訪問用戶信息必須添加安全提示否則會直接崩潰。
1.權限問題
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.
這個就是我點擊相冊的時候的崩潰信息。
根據提示我們在plist文件下添加:
相機 NSCameraUsageDescription type:string
相冊 NSPhotoLibraryUsageDescription type:string
通訊錄 NSContactsUsageDescription type:string
麥克風 NSMicrophoneUsageDescription type:string
2.UIWebView的加載失敗回調error的修飾關鍵字取消了
//加載失敗
- (void)webView:(UIWebView *)webView didFailLoadWithError:(nullable NSError *)error
現在取消了error的修飾關鍵字,要不然會直接爆紅
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error