我有以下代码
if ([[tableView cellForRowAtIndexPath: indexPath].textLabel.text isEqualToString: @"added"]) {
NSLog (@"hello");
FinalViewController *anotherViewController = [[FinalViewController alloc] initWithNibName:@"FinalViewController" bundle:nil];
NSLog (@"hello2");
[self.navigationController pushViewController:anotherViewController animated:YES];
[anotherViewController release];
NSLog (@"hello3");
并且在用户点击时绝对没有任何作用。在测试时,所有日志都会出现,因此我不确定问题所在。
答案 0 :(得分:1)
self.navigationController
可能是零。表视图控制器是如何添加到导航控制器的?
答案 1 :(得分:0)
您是否检查过是否在顶部导入了头文件? 你为什么不尝试使用bundle:[NSBundle mainBundle]?