I have two viewController, both with a table, the application will work, then I added the navigation bar in the second viewController to give him the chance to return in the first viewController. The navigationBar works, but when I want to go in the second viewController, which had previously loaded perfectly, I get this error.
Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '-[ChinaDatabaseTable descrizione]: unrecognized selector sent to
instance 0x8670140'
Does the navigationbar just added?
In the first viewController:
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
ChinaDatabaseMenu *currow =[self.mutableArray objectAtIndex:indexPath.row];
/* The second time it loads this line gives the error, after going in the
second viewController and then went back*/
//.....open the second viewController
if(UI_USER_INTERFACE_IDIOM()== UIUserInterfaceIdiomPhone){
ListViewController * list =[[ListViewController alloc]initWithNibName:@"ListViewController~iPhone" bundle:nil];
list.titoloList = currow.descrizione;
list.labelTitle.font = [UIFont fontWithName:@"Future" size:15];
[self.navigationController pushViewController:list animated:YES];
}else{
ListViewController * list =[[ListViewController alloc]initWithNibName:@"ListViewController~iPad" bundle:nil];
list.titoloList = currow.descrizione;
list.labelTitle.font = [UIFont fontWithName:@"Future" size:30];
[self.navigationController pushViewController:list animated:YES];
}
//.....
}
The problem is not associated with that of navigation, the problem is associated with your’s second view controller (please specify at which controller you used “ChinaDatabaseTable”). For now at SecondView Controller you just comment all your UITableViewCode and also check that datasource as well as delegate must point to nil this case.