From the Apple Docs:
To remove any maximum limit, and use
as many lines as needed, set the value
of this property to 0.
Then you may use this technique in the heightForRowAtIndexPath
method to determine how tall the cell should be.
Constants:
static const CGFloat kCellFontSize = 14.0;
static const CGFloat kCellWidth = 300.0;
static const CGFloat kCellHeightMax = 999.0;
static const CGFloat kCellPadding = 10.0;
Method:
CGSize maxSize = CGSizeMake( kCellWidth, kCellHeightMax );
CGSize labelSize =
[[self cellTextString] sizeWithFont: [self cellFont]
constrainedToSize: maxSize
lineBreakMode: UILineBreakModeTailTruncation];
return (labelSize.height + (2 * kCellPadding));