CCArray with CCListView on Cocos2d-x 2.0 rc0

CCArray with CCListView on Cocos2d-x 2.0 rc0
0.0 0


Thanks for release cocos2d-x 2.0 rc0 version.
I have find out the bug in the CCArray or CCListView, I can’t confirm what should be fix.

I create the CCArray with some String.
then setup the CCListView follow the sample by test project.
After that I just put the CCArray object inside the CCListView and using the CCLabel to display it.

CCArray * layerarray have 7 item.
CCListView numberOfCells have count by: data~~>nNumberOfRows = layerarray~~>count();
CCListView cellForRow just come out to show the content by using

  • CCLayer * l = (CCLayer *)layerarray~~>objectAtIndex;
    ~~ l~~>setTag;
    ~~ cell->addChild(l);

It can show from 0 to 5 nRow correctly.
But when I scroll it to nRow 6, it can’t be show and crash.

I test it on android platform.

Hope both you can fix the problem or let me know is it have something wrong.

Is there an example of using CCListView extension?

Hello. Sorry for offtop, but where do you found the example? I’ve looked at official repository and there is no example project for the CCListView. Could you please point me to the example?


you need to check for the example of CCTextureWatcher.
It is totally using CCListView to display the content.


Thank you! I’m working with User Interface and i’ll use a CCListView if i find a solution to your issue i’ll try to help you




No any developer of cocos2d-x find this bug?
Please help to check or create the issues for cocos2d-x update in the future.


I’ve created a ListView like in CCTextureWatcher and it’s work as expected. In my list i’m displaying 4 elements from 7. I think your problem may lie in the data~~>nNumberOfRows value. In my case i’m using it like this
data~~>nNumberOfRows = (items~~>count + ITEMS_TO_DISPLAY~~ 1) / ITEMS_TO_DISPLAY;


Any difference with the abandoned CCListView and the newly added CCTableView?