objective-c - 使用 UIImagePickerController 在 iOS 13 上使我的应用程序崩溃
问题描述
当相机打开时,无论我是否点击照片,我的应用程序都会崩溃。
下面给出了使应用程序崩溃的线程:
Error : Thread 6 Queue : com.apple.camera.capture-engine.session-queue (serial).
我的代码片段:
-(void)TakePhoto :(id)sender
{
self.appDelegate.PictureTouchIDByPass = true;
self.BSomethingChanged = true;
if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
{
UIImagePickerController* IPC = [[UIImagePickerController alloc] init];
IPC.sourceType = UIImagePickerControllerSourceTypeCamera;
IPC.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;
IPC.cameraDevice= UIImagePickerControllerCameraDeviceRear;
IPC.showsCameraControls = YES;
IPC.navigationBarHidden = NO;
IPC.delegate = self;
[IPC didReceiveMemoryWarning];
[IPC setVideoQuality:UIImagePickerControllerQualityTypeIFrame1280x720];
UIDevice* CurrentDevice = [UIDevice currentDevice];
while ([CurrentDevice isGeneratingDeviceOrientationNotifications])
{
[CurrentDevice endGeneratingDeviceOrientationNotifications];
}
dispatch_async(dispatch_get_main_queue(), ^
{
[self presentViewController:IPC animated:YES completion:nil];
});
}
else
{
[self.appDelegate ShowSingleButtonAlertFromDelegate:NSLocalizedString(@"msg_camera_error", nil) DebugModeError:@""];
}
}
任何帮助,请!
解决方案
推荐阅读
- flutter - 如何在不同的路线之间导航,而不会使屏幕颤动地显示上一条路线的剩余物
- c - strstr 函数返回的字符串与字符串不同
- xml - 滚动视图android中的列表视图和按钮
- protocol-buffers - Protobuf:更改消息名称会导致向后兼容错误吗?
- cron - 使用 ssmtp 格式化来自 crontab 的电子邮件
- python - 错误 - 未定义的变量:'ModelSelect2Widget'
- random - 没有为 `OsRng` 实现 `rand_core::CryptoRng` 特性
- flutter - Flutter DropdownButton 值的问题
- azure - 旋转虚拟机时,密钥保管库秘密出现错误
- vtk - VTK:为什么 vtkImageBlend 结果与 RadiAnt 不同