I made a UITableViewCell subclass, and now I want that subclass to be “clever”. It should align it’s contents to the height of the row. But for this, the cell must know what height value was provided for it in this method:
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
However, no matter what value I assign here, my cell’s frame is 44 px height at initialization time (default style). Is there any way I can get that value from the cell at initialization time?
I assume that you load data in a background process
bacause there is no data at the beginning, it won’t call you heightForRowAtIndexPath so it is using the default cell style with 44px and white background.
if you really want to make it looks the same as it has data. you can put some dummy data(empty string) then your heightForRowAtIndexPath will be called.