简体   繁体   English

如何返回原始场景?

[英]How to return to original scene?

I navigate from scene A to scene B with a segue and want to return to A by touching a button. 我使用场景从场景A导航到场景B,并想通过触摸按钮返回到A。 Do I have to create a new segue to get back or should I do something else? 我是否必须创建新的Segue才能返回,还是应该做其他事情? If I create a new segue, will it be a circular-reference? 如果我创建一个新的segue,它将是一个循环引用吗?

It depends on the way you segue if you are using modal segue style then you have to do this, 如果您使用模态搜索样式,则取决于您搜索的方式,那么您必须这样做,

[self dismissModalViewControllerAnimated:YES];

if push style segue 如果推式segue

[self.navigationController popViewControllerAnimated:YES];

Do any one depending on your segue style in the IBAction method of the button you wish to use. 在您要使用的按钮的IBAction方法中,根据您的segue样式执行任何一项操作。

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

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