Когда камера открывается, нажимаю ли я на фотографию или нет, мое приложение вылетает.
Ниже описана нить, которая вылетает из приложения:
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:@""];
}
}
Любая помощь, пожалуйста!