0

FeedItemとという名前のテーブル ビューに 2 つのプロトタイプ セルを追加しましButtonItemた。そして、私は次のようにcellForRowAtIndexPath見えます:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell;

    if(indexPath.row != [feeds count] - 1)
    {
        cell = [tableView dequeueReusableCellWithIdentifier:@"FeedItem"];

        FeedItem *item = [feeds objectAtIndex:indexPath.row];

        [self configureTextForCell:cell withFeedItem:item];
        [self configureCheckmarkForCell:cell withFeedItem:item];
    }
    else
    {
        cell = [tableView dequeueReusableCellWithIdentifier:@"ButtonItem"];
    }

    return cell;
}

しかし、私のアプリはこのエラーでクラッシュします:

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'

誰かが私が間違っていることを指摘できますか?

4

0 に答える 0