I have the following code in a view controller, which (in all other respects) seems to work fine:
- (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]; }
However, when I run this function, I get the following error:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[ProblemViewController initWithNibName:bundle:]: unrecognized selector sent to instance 0x57ca80'
I donβt understand what could be causing this, so my question is: what is the best way to debug this problem? Is there something obvious that I should check?
iphone
Codebeef
source share