I need to grab the height of a tableView cell from within the tableView:cellForRowAtIndexPath method.
I set the height of the row in tableView:heightForRowAtIndexPath to return 200 for example. However in tableView:cellForRowAtIndexPath, when I do NSLog(@"cell height: %f", cell.contentView.frame.size.height); I don’t get 200, I get the default cell height of 44.0. The size of the cell however is visually correct in the simulator. There must be a way to get the size that is specified in heightForRowAtIndexPath directly without me having to store it in a separate variable – no?
You could just call within the
tableView:cellForRowAtIndexPath.Here’s an example: