cocos2d-x  3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ccCArray.h File Reference

based on Chipmunk cpArray. More...

Detailed Description

based on Chipmunk cpArray.

ccArray is a faster alternative to NSMutableArray, it does pretty much the same thing (stores NSObjects and retains/releases them appropriately). It's faster because:

  • it uses a plain C interface so it doesn't incur Objective-c messaging overhead
  • it assumes you know what you're doing, so it doesn't spend time on safety checks (index out of bounds, required capacity etc.)
  • comparisons are done using pointer equality instead of isEqual

There are 2 kind of functions:

  • ccArray functions that manipulates objective-c objects (retain and release are performed)
  • ccCArray functions that manipulates values like if they were standard C structures (no retain/release is performed)