我有两种不同类型的细胞。我需要在方法中为每个分配不同的大小:
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
我如何确定细胞类型?也许得到它的reuseIdentifier等。
更新 我试试这个时
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"%@", [self.tableView cellForRowAtIndexPath:indexPath]);
}
答案 0 :(得分:1)
您需要确定从_messages数组中获取的对象中的每个单元格。
id object = _messages[indexPath.row];