【发布时间】:2016-05-10 14:15:46
【问题描述】:
我想通过在表格视图中选择一行来推送 SecViewController。我正在使用 Storyboard 来实现它。这是我的代码:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
SecViewController *sec = [[SecViewController alloc] init];
[self.navigationController pushViewController:sec animated:NO];
}
为什么会这样?
【问题讨论】:
-
您正在创建 SecViewController 的新实例,但代码不知道要使用什么“nib”。查看@Balaji 的答案。
标签: ios objective-c uitableview storyboard pushviewcontroller