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:'
誰かが私が間違っていることを指摘できますか?