简体   繁体   English

退出并返回rootViewController的正确方法

[英]Proper way to logout and return to the rootViewController

I have a logout mechanism in place in my ios app that when the user clicks a button, the user gets logged out. 我的ios应用程序中有一个注销机制,当用户单击按钮时,该用户将注销。 How do I redirect properly to the rootViewController? 如何正确重定向到rootViewController?

Do I just do this: 我只是这样做吗?

[self presentViewController:photo animated:YES completion:nil];

尝试这个

 [self.navigationController popToRootViewControllerAnimated:YES];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM