Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xcode 塞格打过电话,但没有被解雇_Xcode_Storyboard_Segue - Fatal编程技术网

Xcode 塞格打过电话,但没有被解雇

Xcode 塞格打过电话,但没有被解雇,xcode,storyboard,segue,Xcode,Storyboard,Segue,我第一次使用故事板,我对segue有一个问题,我的故事板是这样的: __ ViewController / __ TabBarController / \__ ViewController

我第一次使用故事板,我对segue有一个问题,我的故事板是这样的:

                                           __ ViewController
                                          /
                       __ TabBarController
                      /                   \__ ViewController
                     /
 -> TableViewController
                     \
                      \__ NavigationController ___ ViewController
我创建了2个segue,一个用于TabBarController,一个用于NavigationController,标识符为“AddServer”(用于NavigationController)和“GoMainBoard”(用于TabBarController)。从带有自定义测试的TableViewController中,我使用以下代码启动TabBarController或NavigationController

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
        [_tbvDownloads deselectRowAtIndexPath:indexPath animated:YES]; 

        if (indexPath.row == [tableView numberOfRowsInSection:0]-1) {
            [self performSegueWithIdentifier:@"AddServer" sender:self];
        } else {
            ...
                [self performSegueWithIdentifier:@"GoMainBoard" sender:self];
            ...
        }
    }

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    if ([segue.identifier isEqualToString:@"AddServer"])
    {
        UINavigationController *navigationController = segue.destinationViewController;
        ...
    }
    if ([segue.identifier isEqualToString:@"GoMainBoard"])
    {
        UITabBarController *tabBar = (UITabBarController *)segue.destinationViewController;
    }
}
  • (无效)调用了prepareForSegue,但我的Tabbar控制器没有被解雇,有人能解释我在哪里犯了错误吗??谢谢

显然,推送序列只在导航控制器内工作。在其他情况下,您必须使用“模态”类型。希望这能回答你的问题:)

另见: