views:

23

answers:

1

Hi everybody,

I'm currently trying to create a navigation based application, pushing views to change the screen content. I'm trying to set up a button which can allow me to "restart" from the first screen, but I can't figure out a way to do that.

If I "push" the first view, there will be a "back" button, and I'll just have another piece on the view stack. In fact, I'm want to reinitialize that stack.

Is it possible ? (Am I clear ? English is not my first language :) )

+2  A: 

To navigate to the 1st view in navigation stack (i.e. to the root controller) you can simply with just one call:

[self.navigationController popToRootViewControllerAnimated:YES];

If you want to change root controller as well I think you can do that using setViewControllers:animated: method

Vladimir
Thanks for the second tip, it'll me a lot :)
Rob