Reputation: 1371
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.
Upvotes: 1
Views: 411
Reputation: 94
This is just because of UITabbar remove background image for Tabbar.
It works fine for me.
Upvotes: 1