0

我有两个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];

    }

    //.....

  }
4

1 回答 1

0

该问题与导航无关,该问题与您的第二个视图控制器有关(请指定您在哪个控制器上使用了“ChinaDatabaseTable”)。现在,在 SecondView Controller 中,您只需注释所有 UITableViewCode 并检查数据源和委托必须指向 nil 这种情况。

于 2012-11-20T11:20:06.483 回答