我有两个viewController,都带有一个表,应用程序可以工作,然后我在第二个viewController 中添加了导航栏,让他有机会在第一个viewController 中返回。导航栏可以工作,但是当我想进入之前完美加载的第二个视图控制器时,我收到了这个错误。
Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '-[ChinaDatabaseTable descrizione]: unrecognized selector sent to
instance 0x8670140'
导航栏是刚刚添加的吗?
在第一个 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];
}
//.....
}