0

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

Rob
  • 2,766
  • 5
  • 32
  • 39
  • 1
    Possible duplicate of: http://stackoverflow.com/questions/2595049/uinavigationcontroller-how-do-i-delete-a-view-of-a-stack – iwasrobbed Jul 28 '10 at 13:32

1 Answers1

2

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
  • 170,431
  • 36
  • 387
  • 313