开发者

Xcode - Logout button

开发者 https://www.devze.com 2023-04-05 10:41 出处:网络
Apparently, I have one LoginViewController and a StartUpController. LoginViewController has functionality to authenticate user and register new user (presentModalViewController). Once the user has l

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 display StartUpController.

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

0

精彩评论

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