What I would like to do:
In the UITableViewController method heightForRowAtIndexPath I would like to infer the value of the row height rather than hardcoding it.
I set the value previously in the storyboard in Interface builder.
Wrong approach:
The following method is the wrong approach as it is called before the actual cell is created and hence it loops:
// wrong approach
- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
//AppTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AppCel" forIndexPath:indexPath];
//int height = cell.frame.size.height;
// TODO: Make it more dynamic
return 112;
}
Approach I am thinking of:
Is there a way to load the cell main.storyboard document and infer the height value? Or is there some other approach?
Related questions search:
I found the following unanswered related question dating back to 2010. This other question is not of much use as it derives the height from the cell content rather than from the story board document.