开发者

Remove objects from UINavigationController

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 pushViewC开发者_如何学Pythonontroller?), 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜