How to initialize CCArray??

How to initialize CCArray??
0.0 0


I am using CCArray in my code …

CCArray *arr; CCSprite *foo = CCSprite::spriteWithFile("CloseNormal.png"); arr->addObject(foo);

But its giving error, the varibale “arr” is being used without being initialized. How to initialize it then???

Can I create a multidimensional CCArray???


Try this code:

CCSprite *foo = CCSprite::spriteWithFile("CloseNormal.png"); CCArray *arr = CCArray::array(); arr->addObject(foo);

for ccocos2d-1.0.1-x-0.13.0-beta