【发布时间】:2010-08-13 12:06:39
【问题描述】:
我有一个 UITableViewController 作为我的标签栏控制器的第二个标签上的视图控制器之一。
在didSelectRowAtIndexPath 中,我创建了一个详细视图控制器,但它永远不会被推送到导航堆栈上......而且应用程序也不会崩溃,因为我可以在调用pushViewController 后使用 NSLog。
这是方法:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
KeyboardViewController *v = [[KeyboardViewController alloc] initWithNibName:@"KeyboardView" bundle:nil];
[self.navigationController pushViewController:v animated:YES];
NSLog(@"gets here OK");
}
这是什么原因造成的?当然如果navigationController 不存在那么它会崩溃吗?既然这是一个UITableViewController,应该不会自动创建吧?
谢谢
【问题讨论】:
-
奇怪...你确定一切都以它应该的方式存在吗?尝试在该方法上使用断点进行调试...所以您会看到分配了什么,没有分配什么...
标签: objective-c iphone-sdk-3.0 uitableview