I have developed a great class, and I have implemented it in cocos2d.
"CCArray" is like "NSArray" but it's much faster. (based in ccArray)
Some example using CCArray versus NSArray:
Init:
CCArray *array = [CCArray arrayWithCapacity:30];
for (int i = 0; i<30; i++){
[array addObject:[NSNumber numberWithInt:435]]; //Same that NSArray
}
1. - Very very faster. (This way should be used in the cocos2d kernel)
ccArray *arrayData = [array data];
for(int i = 0; i< arrayData->num; i++){
id object = arrayData->arr[i];
//Here your code
}
2. - The usability code (like NSArray):
for(id object in array){ //CCArray is conforms to NSFastEnumerator protocol
//Here your code
}
And the better is that you can replace all NSArray in cocos2d and it works sucessfully.
Edit: I am going to publish the code very soon.