Iphone 如何从选项卡viewController中将另一个viewController推送到navigationController上?

Iphone 如何从选项卡viewController中将另一个viewController推送到navigationController上?,iphone,uitableview,uinavigationbar,uitabbar,Iphone,Uitableview,Uinavigationbar,Uitabbar,我有一个项目使用这两个设置,第二个教程的链接在第一个教程的底部 该教程有点过时,但我设法让它按照广告的方式工作。现在,当用户触摸表视图中的一行时,我想在NavigationController上推送一个新的detailedView 因此,我已将其添加到我的MyTableViewController.m文件中 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

我有一个项目使用这两个设置,第二个教程的链接在第一个教程的底部

该教程有点过时,但我设法让它按照广告的方式工作。现在,当用户触摸表视图中的一行时,我想在
NavigationController
上推送一个新的detailedView

因此,我已将其添加到我的
MyTableViewController.m
文件中

 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // Navigation logic may go here. Create and push another view controller.

     SecondViewController *detailViewController = [[SecondViewController alloc] initWithNibName:@"SecondViewController.xib" bundle:nil];
     // ...
     // Pass the selected object to the new view controller.

     [self.navigationController pushViewController:detailViewController animated:YES];
     [detailViewController release];
}
现在,当我运行此项目并触摸表视图中的一行时,我得到一个错误:

asm_Terminating_due_to_uncaught_exception
从nib加载
SecondViewController
似乎有问题,但是我检查了
detailViewController
,它不是零

我知道我遗漏了一些东西,很可能是一些简单的东西


请帮助。

好的,正如我所说,我缺少了一些简单的东西,修复方法是从nib名称中删除.xib

//change line SecondViewController *detailViewController = [[SecondViewController alloc] initWithNibName:@"SecondViewController.xib" bundle:nil];
//to
 SecondViewController *detailViewController = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];