我有两个viewController,都有一个表,应用程序会工作,然后我在第二个viewController中添加了导航栏,让他有机会在第一个viewController中返回。 navigationBar可以工作,但是当我想进入第二个以前完全加载的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];
}
//.....
}
答案 0 :(得分:0)
问题与导航问题无关,问题与您的第二个视图控制器有关(请指定您使用“ChinaDatabaseTable”的控制器)。现在在SecondView Controller中,您只需注释所有UITableViewCode,并检查数据源和委托必须指向nil。