I’ve modified CCTableView to allow for variable-sized cells, and thought it may save others some time. The modified version has the old “fast-path” (fixed sized cells), but will turn to table-walking if your CCTableViewDataSource returns “false” from hasFixedCellSize(). By default, it operates as before. To turn on the magic:
Even though it has to walk the items to calculate a cumulative size, I’ve tested it with a few thousand items on an iPhone 4S with no problems. If your data set is huge, an offset-to-index mapping with a binary search could be implemented. I’ll leave that as an exercise to the reader.
My version has become pretty forked from the original with heuristic/average-height cell size estimations for large data sets etc. As I’ve been under a pretty tight deadline, it’s not the cleanest or most general CCScrollView anymore. When I get some time, I’d like to port back the useful things to CCScrollView in a more general way and issue a pull request. Unfortunately, that may be some weeks into the future, at best.
My apologies for letting this linger, I’ve been contacted about it a few times.
The project that required this feature was cancelled shortly after my last post, and further work wasn’t really in a state to try to push. I no longer have access to the source repository, so the best I can do is what’s published in that Gist. I’ve meant to update you guys a few times, but my schedule kept letting it slip through the cracks.