-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
id data = [self.MActiveModelArr objectAtIndex:indexPath.row];
YZActiveDetailTableCell * cell = (YZActiveDetailTableCell * )[self tableView:tableView preparedCellForIndexPath:indexPath withData:data];
return cell.frame.size.height;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
id data = [self.MActiveModelArr objectAtIndex:indexPath.row];
YZActiveDetailTableCell * cell = (YZActiveDetailTableCell * )[self tableView:tableView preparedCellForIndexPath:indexPath withData:data];
if ((indexPath.row ) == [_mActiveModelArr count]-1 ) {
cell.MLineView.hidden = true;
}
[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
return cell;
}
- (UITableViewCell *)tableView:(UITableView *)tableView preparedCellForIndexPath:(NSIndexPath *)indexPath withData:(id)data
{
NSString *key = [NSString stringWithFormat:@"%ld-%ld",(long)indexPath.section, (long)indexPath.row];
//try to get the cell from cache
YZActiveDetailTableCell *cell = [_mCellCache objectForKey:key];
if (!cell)
{
cell = [[YZDetailReplyTableCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"replayYZCell" ];
[cell updateWithNote:data];
// cache it, if there is a cache
[_mCellCache setObject:cell forKey:key];
}
return cell;
}