How to show another view after a UIImagePickerCont

2019-09-14 19:57发布

问题:

I've a tabbar with a button, you click it and you see an UIImagePickerController. After the user choose the image I want another view. How can I do it?

I've this:

- (void)imagePickerController:(UIImagePickerController *)picker
  didFinishPickingImage : (UIImage *)image
             editingInfo:(NSDictionary *)editingInfo
{
imageToPost.image = image;
[picker dismissModalViewControllerAnimated:YES];
PostPopupViewController *postPopup = [[PostPopupViewController alloc] init];
[self presentModalViewController:postPopup animated:YES];
}

But it returns this error:

* Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Attempting to begin a modal transition from to while a transition is already in progress. Wait for viewDidAppear/viewDidDisappear to know the current transition has completed'

回答1:

Try these:

Exception in iPhone app : Modal transition is already in progress

Presenting a modal view controller only after another one has been dismissed

iPhone - Detect the end of the animation

Present another modal view from UIImagePickerController