views:

72

answers:

1

I would like to know if there is a way to know which objects [UIViewControllers?] are stored inside [self navigationController] (I'm guessing they are stored there with pushViewController?), and if there is a way to remove such objects.

Consider this scenario:

1.- Show "Presentation screen" (a logo)

2.- Wait 2 seconds

3.- Push "Data screen" (no need for "Presentation screen" anymore but it's stored in Memory)

Thanks for your time.

A: 

There are ways to do this, check UINavigationController's methods popToViewController:animated: and popViewControllerAnimated:. Just pop twice if you don't know the controller you want to pop to.

If this is the initial controller, however, it may be easier to start with your root view controller being the "data screen", and push the "presentation screen" onto the stack in the DataScreenViewController's viewDidLoad or viewDidAppear and used a delayed method to push it after 2 seconds.

corprew

related questions