简体   繁体   English

解除uiimagepicker时崩溃

[英]Crash while dismissing uiimagepicker

在此处输入图片说明 This is an issue reported at crashlytics. 这是crashlytics报告的问题。 I am getting this(I assume) when I load image picker and dismiss. 加载图像选择器并关闭时,我得到了这个(我假设)。 I only got this once. 我只有一次。 But it got something to do with image picker or navigation controller. 但这与图像选择器或导航控制器有关。 Does any one know the cause? 有人知道原因吗?

Update Image picker camera is loaded like this. 这样会加载更新图像选择器相机。

    UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
    imagePickerController.modalPresentationStyle = UIModalPresentationFullScreen;
    imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
    imagePickerController.delegate = self;
    if([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationLandscapeLeft)
    {
        [[UIDevice currentDevice]setValue:[NSNumber numberWithInteger:UIDeviceOrientationLandscapeRight] forKey:ORIENTATION_STRING];
    } else {
        [[UIDevice currentDevice]setValue:[NSNumber numberWithInteger:UIDeviceOrientationLandscapeLeft] forKey:ORIENTATION_STRING];
    }

    self.imagePickerController = imagePickerController;
    [self.navigationController presentViewController:self.imagePickerController animated:YES completion:nil];

for other source types, I am using the following code. 对于其他源类型,我正在使用以下代码。

UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.sourceType = sourceType;
imagePickerController.delegate = self;
popOver = [[UIPopoverController alloc] initWithContentViewController:imagePickerController];
self.imagePickerController = imagePickerController;
popOver.delegate = self;
CGRect popOverRect = sender.frame;
[popOver presentPopoverFromRect:popOverRect
                         inView:self.view
       permittedArrowDirections:UIPopoverArrowDirectionRight animated:YES];

Add UIIMagePickerController to ContainerView. 将UIIMagePickerController添加到ContainerView。 & then to view 然后查看

UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.mediaTypes = [[NSArray alloc] initWithObjects: (NSString *)   kUTTypeMovie, nil];

[self addChildViewController:picker] ;

[picker didMoveToParentViewController:self] ;

[self.view addSubview:picker.view] ;

while removing pickercontroller do 同时删除pickercontroller做

[picker.view removeFromSuperview] ;
[picker removeFromParentViewController] ;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM