在切换到视频捕获模式后,使用ios 13真实设备的iPhone上的UIImagePickerController崩溃。崩溃在UIImagePickerController的第二次演示中重现。崩溃不会在ios 13(真实设备)之前的版本上重现。相机和麦克风的使用描述键在Xcode 11.0内置的Info.plist Test应用程序中设置
步骤:
当前的UIImagePickerController 关闭UIImagePickerController 目前的UIImagePickerController 点按视频按钮->崩溃 如果我设置videoQuality = UIImagePickerControllerQualityTypeHigh,则崩溃不会重现。但是我需要UIImagePickerControllerQualityTypeMedium。
@interface ViewController () < UINavigationControllerDelegate, UIImagePickerControllerDelegate>
@end
@implementation ViewController
#pragma mark - IBActions
- (IBAction)showPicker:(UIButton *)sender {
UIImagePickerController *pickerController = [UIImagePickerController new];
pickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
pickerController.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypeCamera];
// pickerController.videoQuality = UIImagePickerControllerQualityTypeHigh;
pickerController.delegate = self;
[self presentViewController:pickerController animated:YES completion:NULL];
}
#pragma mark - UIImagePickerControllerDelegate
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<UIImagePickerControllerInfoKey, id> *)info {
[self dismissViewControllerAnimated:YES completion:NULL];
}
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
[self dismissViewControllerAnimated:YES completion:NULL];
}
@end
“ NSInvalidArgumentException”,原因:“ ***-[AVCaptureDevice setActiveColorSpace:]不支持-使用activeFormat.supportedColorSpaces”
答案 0 :(得分:0)
在pickercontroller中设置视频质量
[pickerController setVideoQuality:UIImagePickerControllerQualityTypeIFrame1280x720];