MegaManX
MegaManX

Reputation: 8918

iPhone dismissing multiple controllers?

I suspect many have had this case - you present modal view controller, which then present navigation view controller, that has many table view controllers pushing onto the stack. Basically, pushing and presenting controllers. When you get to last you have to dismiss them all, and return to root view controller

Do i have to call for every modal controller dismiss, and for every pushed controller pop, or is there a better way to do this?

I am using iOS5 storyboards if that is relevant somehow.

EDIT: Thanks for answes but its little more complicated than that - basically i present modal view controller from root controller, than push couple of controllers, then present one more modal view. At that time I want to go to root controller. So just poping view controllers want do it, some of them have to be dissmised

Upvotes: 0

Views: 288

Answers (1)

Lefteris
Lefteris

Reputation: 14677

You can return back to the root navigation controller by calling:

[self.navigationController popToRootViewControllerAnimated:YES];

And then release your modal view controller

Upvotes: 4

Related Questions