cocos2d-x移植于cocos2d-iphone,cocos2d-iphone的架构和设计更符合Objective-C的语法,所以cocos2d-x在移植的过程中,也引入了CCArray的概念!
CCArray在设计和使用上更符合Objective-C的风格,类似于Objective-C中的NSArray!
1. CCArray只是提供了一个面向对象的封装类
其继承于CCObject类(CCObject的存在主要是为了自动管理内存),并提供了一系列接口,包括
创建
/** Create an array */
static CCArray* create();
/** Create an array with some objects */
static CCArray* create(CCObject* pObject, ...);
/** Create an array with one object */
static CCArray* createWithObject(CCObject* pObject);
/** Create an array with capacity */
static CCArray* createWithCapacity(un