While choosing an image from the image picker in iOS 10
Objective-C
and Xcode 8
. I am getting an error -
Creating an image format with an unknown type is an error
.
It was ok for the previous version.
Here is my code:
UIImagePickerController* imgPicker=[[UIImagePickerController alloc] init];
imgPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imgPicker.delegate = self;
[self presentViewController:imgPicker animated:YES completion:nil];
and the delegate method to recive the image is..
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
[picker dismissViewControllerAnimated:YES completion:NULL];
UIImage *myImage = [info objectForKey:UIImagePickerControllerOriginalImage];
}
I also tried other delegate function..
-(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *,id> *)info{
}
but error not going.
I am not sure is it the bug of Xcode 8?
If any one faced the issue and solved please help to fix it.
It's a bug. It's just a false warning. No bad thing is happening to the working of the app, so ignore the warning.