开发者

How do I reset the state of a view inside a tabbar?

This is a fairly straightforward question though my Googling session gave me nothing.

How do I reset the state of a view hierarchy located in a tabbar programmatically? The behavior I want to replicate is when the user tapps on a tab twice. This causes the view located under that tab to return to it's initial state.

The tab is "owned" by a UINavigationController and when the user reaches a certain point in the view hierarchy there is a button which I want to connect this behavior to.

All my attempts have failed exce开发者_如何学Gopt calling on a method in AppDelegate which kills the view and adds it back to the UITabBarController again. But this does not feel like the right way to go.

Thanks in advance.

Best regards //Abeansits


I am not sure if I understand the question correctly but I think you should look at

popToRootViewControllerAnimated 

http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UINavigationController_Class/Reference/Reference.html#//apple_ref/occ/instm/UINavigationController/popToRootViewControllerAnimated:

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜