Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

presentModalViewController does not work if called too early

If I dismiss the the modal VC and present it (or another one) again in less than a certain amount of time, it does not appear. Am I missing something?

like image 645
gurghet Avatar asked May 18 '26 04:05

gurghet


1 Answers

Yes, you can't do that. I'm assuming what you did is something like this:

 [self dismissModalViewControllerAnimated:YES];
 [self presentModalViewController:myNewController animated:YES];

This doesn't work. I don't know exactly why, but it is related to the animations I believe. Your options are to either dismiss the first one without animation, or else wait to present the new one in viewDidAppear of the parent, (or possibly viewDidDisappear for the previous modal view, not sure if that works though).

like image 108
Alex Gosselin Avatar answered May 19 '26 19:05

Alex Gosselin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!