I’m reading through TableView_iPhone tutorial from Apple and I’m trying to use ‘The Technique for Static Row Content’ technique to populate a TableView with cells from a NIB file.
In the tutorial the NIB files have different heights and the TableView is showing them properly. When I return UITableViewCell from tableView:cellForRowAtIndexPath: the height of a cell from the NIB file is not taken and all cells have the same height.
Is it possible that TableView retrieves the height automatically? Or am I missing something in the tutorial?
Is implementing tableView:heightForRowAtIndexPath: the only way to go?
Yes, you need to implement heightForRowAtIndexPath. It is called to quickly calculate heights of rows, withour creating them.
So, you shouldn’t perform any time-consuming operations in that heightForRowAtIndexPath.