【发布时间】:2009-03-08 01:29:35
【问题描述】:
我在视图控制器中有以下代码(在所有其他方面)似乎工作正常:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
ProblemViewController *problemViewController = [[ProblemViewController alloc] initWithNibName:@"ProblemViewController" bundle:nil];
problemViewController.problem = (Problem*)[self.problems objectAtIndex:indexPath.row];
[self.navigationController pushViewController:problemViewController];
[problemViewController release];
}
但是,当我运行此函数时,我收到以下错误:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[ProblemViewController initWithNibName:bundle:]: unrecognized selector sent to instance 0x57ca80'
我不知道是什么原因造成的,所以我的问题是:我应该如何最好地调试这个问题?有什么明显的我应该检查的吗?
【问题讨论】:
-
我觉得这很有帮助:stackoverflow.com/a/7156336/403423
标签: iphone