I’m developing a iPhone App, in which I’m changing the ViewController using presentModalViewController method upto 2/3 levels (e.g. Home–>Option–>Other–>More).
Now I want to get my app back to first screen or ViewController. If I use dismissModalViewControllerAnimated method, it just dismisses the current view controller only. But I want to clear the stack and start the Home screen again.
Thanks for any help.
Set the delegates properly for each level. So if you press Cancel or Done in More, it will call somehting like
[other moreViewDidCancel]inside of which, you will calldismissModalViewController:Animated:and notify its parent view controller (delegate) that is should dismiss( so,[option otherViewDidCancel]) and so on till the top level.