Xcode 塞格打过电话,但没有被解雇
我第一次使用故事板,我对segue有一个问题,我的故事板是这样的:Xcode 塞格打过电话,但没有被解雇,xcode,storyboard,segue,Xcode,Storyboard,Segue,我第一次使用故事板,我对segue有一个问题,我的故事板是这样的: __ ViewController / __ TabBarController / \__ ViewController
__ 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控制器没有被解雇,有人能解释我在哪里犯了错误吗??谢谢