简体   繁体   中英

While selecting image from imagePicker, app gets crashes for iOS11.2.6, Xcode 9.2

I have one imageView and I want to select image from Camera/Gallery to keep selected image on imageView. But, on selection of Gallery, my app gets crashing in iOS 11.2.6 with given error:

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Only RGBA or White color spaces are supported in this situation.'

But, it is working fine for iOS version less than 11. I have added all the required things in info.plist. Still it is not working for iOS 11.

Please help me out in this.

Updated: My Code

UIAlertController *actionSheet = [UIAlertController alertControllerWithTitle:nil message:@"Choose From" preferredStyle:UIAlertControllerStyleActionSheet];

    [actionSheet addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {

        // Cancel button tappped.
        [self dismissViewControllerAnimated:YES completion:^{
        }];
    }]];

    [actionSheet addAction:[UIAlertAction actionWithTitle:@"Gallery" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
        UIImagePickerController *imgpicker = [[UIImagePickerController alloc] init];
        imgpicker.allowsEditing = YES;
        imgpicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
        imgpicker.delegate=(id)self;
        [self presentViewController:imgpicker animated:YES completion:nil];
    }]];

[self presentViewController:actionSheet animated:YES completion:nil];

I am using the same code for another project, so it working for another project. But for this project it is crashing.

This is just because of UITabbar remove background image for Tabbar.

It works fine for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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