Apparently, I have one LoginViewController
and a StartUpController
.
LoginViewController
has functionality to authenticate user and register new user (presentModalViewController
). Once the user has logged in, my system will displayStartUpController
.
Inside this StartUpController
, I have everything such as TabBarController, Na开发者_高级运维vigationController, etc. This StartUpController
is actually handling 5 different views.
My question is: what should I do to remove all of my views when my user click on "LogOut" button from one of my view?
I want to show my LoginViewController again.. but at the same time, remove the StartUpController view and all its views.
Please teach me how to do this:
If your authentication view is your root view controller's view, use the -popToRootViewControllerAnimated:
method on your navigation controller reference, e.g.:
[myNavigationController popToRootViewControllerAnimated:YES];
Assuming you're not doing any weirdness with view controller ownership, the navigation controller will release the children view controllers (which, in turn, should release their views and other properties).
精彩评论