如何解雇一个带有故事板的viewController从推segue? [英] How dismiss a viewController with storyboard from a push segue?

查看:112
本文介绍了如何解雇一个带有故事板的viewController从推segue?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道为什么 dismissViewControllerAnimated:completion:

  

[self performSegueWithIdentifier:@my_seguesender:self];

但是我调用dismiss比没有发生任何事情。我可以创建另一个segue,但它创建一个新的视图控制器。



我的问题是:如何驳回 performSegueWithIdentifier:sender:

  

[self performSegueWithIdentifier:@my_seguesender:self];

如果是这样,您需要使用:

  [self.navigationController popViewControllerAnimated:YES]; 

以弹出堆叠的视图。有一个segue调用,但框架似乎调用:

  presentViewController:animated:completion:

或:

  pushViewController:animated :



Ray


I don't know why dismissViewControllerAnimated:completion:. I just want to do it.

I start with a

[self performSegueWithIdentifier:@"my_segue" sender:self];

But is I call the dismiss than nothing happens. I can create another segue, but it create a new view controller.

My question is: How dismiss the performSegueWithIdentifier:sender:?

解决方案

Do you have a navigationBar in the viewController that's calling:

[self performSegueWithIdentifier:@"my_segue" sender:self];

If so, you'll need to use:

[self.navigationController popViewControllerAnimated:YES];

to pop the view off the stack. There's one segue call, but the framework seems to call:

presentViewController:animated:completion:

or:

pushViewController:animated:

as appropriate.

Ray

这篇关于如何解雇一个带有故事板的viewController从推segue?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆