是否可以使用PerformSegueWithIdentifier并使发件人成为另一个viewcontroller

时间:2013-04-26 13:04:07

标签: iphone ios xcode

不确定是否可行,但我想

 [self performSegueWithIdentifier:@"ToAController" sender:SomeOtherViewController];

我可能不会这样做,甚至接近右边,但我想这样做,所以我的导航流程正常工作(如不回到“ToAController”,而是回到“SomeOtherViewController”

编辑

澄清我的导航流程

字母和数字是视图

1→2

1→A-→2

1·-2

B< -2

1·; -A

我不想要任何东西回去(有一个后退按钮'A'

1 个答案:

答案 0 :(得分:3)

发件人可以是任何类型的对象,发件人将在调用- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender方法的视图控制器的performSegue方法中接收。

另一件事我不知道你试图通过回去说什么,但是如果你想回到已经添加到navigationController堆栈中的视图控制器那么你应该使用< UINavigationController的em> pop方法而不是segues,因为segue只会执行push / modal / custom操作,这会将destinationController添加到UINavigation控制器堆栈。

修改

表单iOS 6有一种名为 unwind 的新类型的segue,它可以链接到storyboard中View Controller的绿色 Exit 图标。而且因为我不想从其他心爱的SO成员那里窃取选票,这里有关于放松 segues的好主题 What are Unwind segues for and how do you use them?