iOS5 - 故事板 - 导航控制器的多个分段 [英] iOS5 - Storyboard - Multiple Segues from Navigation Controller

查看:84
本文介绍了iOS5 - 故事板 - 导航控制器的多个分段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在为客户端的应用程序上使用iOS5,我需要根据tableviewcell的状态从UINavigationController动态执行不同的segue。

I have been working with iOS5 on an app for a client, and I need to execute a different segue dynamically from a UINavigationController based on a state of the tableviewcell.

如果您看到故事板(附在此处 http://www.online.com.bo/ apple / multinavigationsegues.png ),基本上有两个从导航控制器生成的segue,我需要绕过导航控制器执行其中一个segue,但我不确定如何。

If you see the storyboard (attached here http://www.online.com.bo/apple/multinavigationsegues.png), basicaly there is 2 segues generated from the navigation controller, I need to "bypass" the navigation controller to execute one of the segues, but I'm not sure how.

附上我在ROOT tableview控制器上执行基本segue的代码。

Attached is the code I have on the ROOT tableview controller to perform the base segue.

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([[segue identifier] isEqualToString:@"CategorySegue"])
    {
        UINavigationController *navigationController = segue.destinationViewController;

        CategoryDetailsViewController *categoryDetailsViewController = [[navigationController viewControllers] objectAtIndex:0];

        categoryDetailsViewController.delegate = self;
        categoryDetailsViewController.templateID = self.templateID;
    }
}

请帮助!!!

推荐答案

在我看来,2个segues应该来自Categories View Controller。将导航控制器置于类别视图控制器之前。您可以手动执行segues与

It seems to me the 2 segues should be coming from the Categories View Controller. Put your navigation controller ahead of Categories View Controller. You can manually perform segues with

- (void)performSegueWithIdentifier:(NSString *)identifier sender:(id)sender

因此在类别视图控制器中,无论触发什么事件,都要检查tableviewcell的状态,并使用标识符调用perfromSegueWithIndentifier。适当的segue。

So in Categories view controller whatever event is the trigger check the state of your tableviewcell and call perfromSegueWithIndentifier using the identifier of the appropriate segue.

这篇关于iOS5 - 故事板 - 导航控制器的多个分段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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