CCTableView problem with reloadData().

CCTableView problem with reloadData().
0.0 0


Using cocos2d-x 2.0.4


  1. create a CCTableView with a NULL datasource
  2. create a CCTableView with a 0 element datasource
  3. add elements to datasource
  4. call reloadData() on CCTableView
  5. touch the CCTableView


  1. NOK: Crash. Lazy attach to datasource not possible
  2. OK. Fixed in 2.0.4
  3. OK.
  4. NOK: CCTableView is invisible (not drawn)
  5. OK: CCTableView cells are magically drawn :slight_smile:

Please fix these issues.


EDIT: I fixed point 4 with this:


Thanks Mircea, I will review and test it. :slight_smile:


I found if I replace the new code from github pulled by you , it will cause another problem , when I reloadData , the tableView will scroll to the first row always , this is not good experience.




Well at least the items are drawn :slight_smile:
The scenario I provided is quite common in games which download data (ie. top scores) from a web server.

While talking about it, it would also be nice to be notified when scrolling to the begining / end of the datasource items, so we can request more items from web server (see the “Endless List” pattern on Android).