I'll write as I did, but write the code yourself. I suppose that with the parsing you have already done it yourself. You have some kind of structure where dates, numbers and lines are stored (I will generally call the message a message for simplicity). You make a table with the property style = UITableViewStyleGrouped, in which case the individual sections will be presented as tables. The number of sections (it is returned from numberOfSectionsInTableView: UITableDataSource) is equal to the number of messages. Then in each section there are two cells (returned from the corresponding datasource method), the top one is a regular cell number and date is textLabel and detailTextLabel cells, these are ordinary UILabel and their appearance is customized, the only thing I don’t remember exactly which of the default cell styles leads himself as in the picture, he seems to be there only 4.
Now the most interesting thing to set the variable height of cells is to use the method - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
, as it is not difficult to guess, indexPath.section is the message number, and indexPath.row is or 0 for the number and date, then you can return a constant, or 1 for a long string. For a long string, you can use the NSString method - (CGSize)sizeWithFont:(UIFont *)font forWidth:(CGFloat)width lineBreakMode:(UILineBreakMode)lineBreakMode
, which will give the required size on which it fits, well, then take its height, add a little on indents and forward.
Well, when you draw the cell itself, you will either need to create a new label of this size, set it to numberOfLines = 0 and add it to the cell, or do the same with the textLabel cell. Bottlenecks - in the first case, you need to remember about the reuse of cells and place the inscription only once while creating a cell, and in the second you are not sure how the cell autodisplacement will work, you may need to make your successor and rewrite layoutSubviews