简体   繁体   English

“翘曲”查看iPhone iOS

[英]“Warp” to a view iPhone iOS

I am currently developing an App based on a Navigation Controller. 我目前正在开发基于导航控制器的应用程序。 However, when the user logs out, I'd like to go to the initial screen and destroy all of the other views that were stacked. 但是,当用户注销时,我想转到初始屏幕并销毁所有其他堆叠的视图。 What is the best way to do that? 最好的方法是什么?

EDIT: 编辑:

I've tried doing what both answers suggested but I got a nil navigationViewController . 我已经尝试做两个答案都建议的事情,但是我得到了nil navigationViewController So I'll add another detail that I thought was not useful before. 因此,我将添加另一个我以前认为没有用的细节。 Actually I am trying to perform this operation from a TabViewController that is embedded in a NavigationController. 实际上,我正在尝试从NavigationNavigator中嵌入的TabViewController执行此操作。 I apologize if that changes anything. 如果这有任何改变,我深表歉意。

[self.navigationController popToRootViewControllerAnimated:YES];

发送popToRootViewControllerAnimated消息到导航控制器

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

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