******How to have a dynamic heightForRow:******
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
NSString *cellText = [[TableViewData news] valueForKey:[NSString stringWithFormat:@"%d",[indexPath row]]];
UIFont *cellFont = [UIFont fontWithName:@"Helvetica" size:10.0];
CGSize labelSize = [cellText sizeWithFont:cellFont
constrainedToSize:constraintSize
lineBreakMode:UILineBreakModeWordWrap];
return lableSize ;
}
*******What I have to work with:********
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
BMOptionCell *cell = objCellClicked;
if ([indexPath row] == selectedRowNumber) {
if (!(selectedRowNumber == rowExpanded)) {
self.rowExpanded = [indexPath row];
cell.infoLabel.hidden = NO;
return 250;
}
if (selectedRowNumber == rowExpanded) {
cell.infoLabel.hidden = YES;
self.rowExpanded = -1;
return 69;
}
}
return 69;
}
Comments