我有我的第一个普通视图控制器,其中包含一个UITableView。需要在这些行中显示的项目完美地工作。
现在问题来了,如果用户选择一行,我想打开一个新视图。这种观点称为SecondViewController。所以我有以这种方式命名的.h,.m和.xib文件,它属于UIViewController类。
我正在使用CustomCelltableview 这可能是问题吗?
我#imported一切正常,这是我在方法中使用的代码:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
SecondViewController *secondViewController = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];
[self.navigationController pushViewController:secondViewController animated:YES];
}
我到底做错了什么?我已经在这里看了几个小时的问题,但似乎没有任何效果。