我在一个视图控制器中有以下代码,除此之外似乎一切正常:
- (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'
我不知道是什么导致了这个问题,所以我的问题是:我应该如何最好地调试这个问题?有什么明显的东西我应该检查吗?