0

我有两种不同类型的细胞。我需要在方法中为它们中的每一个分配不同的大小:

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath

如何确定细胞类型?也许得到它的重用标识符等。

更新 当我尝试这个

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSLog(@"%@", [self.tableView cellForRowAtIndexPath:indexPath]);
}

我收到一个例外 在此处输入图像描述

4

1 回答 1

1

您需要确定从 _messages 数组中获得的对象的每个单元格。

id object = _messages[indexPath.row];

于 2015-08-23T18:30:07.587 回答