views:

55

answers:

1

I need a way to alter the UITableView row height differently, but without implementing the delegate method -tableView:heightForRowAtIndexPath: because it causes me some serious performance problems in an indexed table with 15.000 rows.

Now the thing is, that every third table is 10 units bigger. than the others. These are a different kind of UITableViewCell subclass.

But I couldn't find a property in UITableViewCell that could help here. What could I do?

+1  A: 

You cannot usefully set the cell's height from the cell class itself. The only options are that delegate method and setting rowHeight on the table view, which obviously applies the same height to all cells.

Looks like the docs acknowledge there are performance issues for that delegate when using more than 1000 cells or so.

Perhaps you can split you table in sections and set those larger cells as table section headers (you can specify a separate height for those). Then you will have to deal with the way section headers start to stack at the top of the table; I don't know for sure but you may be able to alter that behavior.

MihaiD