Question

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?

Was it helpful?

Solution

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).

OTHER TIPS

You cant dismiss two modal view controllers right after another, aside from what the other poster suggested, you can wait a small amount of time before dismissing the other modal view, for example

[self performSelector:@selector(method) withObject:nil afterDelay:.5];

where the method called just dismisses your other modal view. The snippet of code performs the selector after .5 seconds and can be used when having animation timing problems like the one you describe, to seperate the call times in order for them to execute properly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top