我有一个使用这两个教程设置的项目,第二个教程的链接在第一个教程的底部。
该教程有点过时,但我设法让它像宣传的那样工作。现在我想在NavigationController
用户触摸表格视图中的一行时将一个新的 detailView 推送到。
所以我把它添加到我的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
IT 似乎在SecondViewController
从 nib 加载时遇到问题,但是我检查了detailViewController
它,它不是 nil。
我知道我遗漏了一些东西,而且很可能是一些简单的东西。
请帮忙。