Hihi all,
Probably this is a fairly simple question, but I am new and just couldn’t get it resolved. Okay, here is the problem:
- I have main view controller, in this controller’s viewdidAppear delegate, I use
[self presentModalViewController animated:YES];to show my second view. - In one of the method in my second view controller, it initiated the third controller for certain process.
- After the process in the third controller, it initiates again the second controller to call a method in the second controller. In this method, I use
[self dismissModalViewControllerAnimated:YES];but the second view just refuses to dismiss.
Hope I am clear enough on my scenario. Please advice. Thanks in advance!
🙂
@from the post:After the process in the third controller, it initiates again the second controller to call a method in the second controller.
This shows that you are initiating a new instance of secondViewController which don’t have a modalViewController presented in it. You should call the dismissModalViewControllerAnimated for the instance in which you actually presented it.
Like below
Design your thirdViewController like this
and
…
And in third view call the dismissModalViewController as below