![](/img/trans.png)
[英]Issue with switching between UIPickerViews in one UIViewController
[英]Issue switching between UIViewController
我有一个标签栏应用程序,因为我可以在UIViewController
之间切换而不会丢失任何类型的数据。 但是现在我想使用UIButton
更改UIViewController
。 我已经使用Show使用了简单的情节提要板快捷方式。 但是当我返回主UIViewController
我丢失了所有数据和功能。 如何在UIViewController
之间切换而又不重新创建新的UIViewController
但又回到原来的状态。
不要使用segue。 它将实例化目标视图控制器的新实例。
在UIButton的动作中,说出类似以下内容:
self.tabController.selectedIndex = 1 //or whatever the index of the view controller you want to switch to is
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.