在prepareForSegue中崩溃与无法识别的选择器

时间:2014-02-12 03:09:12

标签: ios objective-c nsarray

问题在于这一行:

ExtraTeamInfoObject *item = [tableData objectAtIndex:row];

请查看以下代码,

-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if([[segue identifier] isEqualToString:@"teamDetailsSeg"]) {

        TeamDetailsTableViewController *detailViewController = [segue destinationViewController];

        NSIndexPath *myIndexPath = [self.tableView indexPathForSelectedRow];
        long row = [myIndexPath row];

        ExtraTeamInfoObject *item = [tableData objectAtIndex:row]; 
        // THIS IS THE PROBLEM

        detailViewController.teamDetailModel = item;
    }
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"StandingsIdent";

    StandingsViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];

    TeamObject *item = [tableData objectAtIndex:[indexPath row]];

    long row = [indexPath row];

    if ([item isKindOfClass:[TeamObject class]]) {

        cell.cellTeamName.text = item.teamName;
        cell.cellTeamLogo.image = item.teamLogo;
        cell.cellPlayed.text = item.matchesPlayed;
        cell.cellWins.text = item.wins;
        cell.cellTies.text = item.ties;
        cell.cellLoses.text = item.loses;
        cell.cellPoints.text = item.points;
        cell.cellTeamPosition.text = _teamPosition[row];
        cell.cellInfo.text = _infoLeague[row];

    }
    else {}
}

有谁知道发生了什么事?

  

* 由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:' - [TeamObject teamFullNames]:   无法识别的选择器发送到实例0x10ac548b0'

0 个答案:

没有答案