前一段系统升级到iOS10,但是挡不住想调试的心,于是下载Xcode8.0Beta进行代码调试
但当遇到以下代码时
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePicker.delegate = self;
imagePicker.view.backgroundColor = [UIColor whiteColor];
[weakSelf.navigationController presentViewController:imagePicker animated:YES completion:nil];
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.
翻译成中文
你需要在info.plist文件 添加一个“ NSPhotoLibraryUsageDescription ”的Key,Value添加一个描述。
第一步
但当遇到以下代码时
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePicker.delegate = self;
imagePicker.view.backgroundColor = [UIColor whiteColor];
[weakSelf.navigationController presentViewController:imagePicker animated:YES completion:nil];
控制台出现崩溃
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.
翻译成中文
你需要在info.plist文件 添加一个“ NSPhotoLibraryUsageDescription ”的Key,Value添加一个描述。
第一步