I use un UINavigationCtronller to navigate from to UIViewController A an UIViewController B.
On the view of the UIViewController B, I tap a button and call UIImagePicker
UIImagePickerController *ipc = [[UIImagePickerController alloc] init];
ipc.sourceType = UIImagePickerControllerSourceTypeCamera;
ipc.delegate = self;
ipc.allowsEditing = NO;
[self presentModalViewController:ipc animated:YES];
if I tap the ‘Cancel’ button of UIImagePicker, I call
-(void)imagePickerControllerDidCancel:(UIImagePickerController*)picker{
[picker dismissModalViewControllerAnimated:YES];
}
UI will return to UIViewController A rather than B
If I tap any place, app crashed.
Welcome any comment
Instead of
try
You want the ViewController that is presenting the picker to dismiss, not the picker itself.