You can indeed, CCArray can to hold any instances derived from CCObject.
Can you show us more code, especially the definition of boxArray?
Using boxArray[i+j] you treat it as if was an array of CCArrays, notation array[index] is equivalent to *(array + index). As the STL said:
When a C or C++ compiler sees this, the array is immediately rewritten to be a pointer. This rewriting is so immediate that sizeof and decltype will observe a pointer.
What you probably meant was: boxArray->objectAtIndex( i+j ) = box;
You can indeed, CCArray can to hold any instances derived from CCObject.
Can you show us more code, especially the definition of boxArray?
Using boxArray[i+j] you treat it as if was an array of CCArrays, notation array[index] is equivalent to *(array + index). As the STL said:
When a C or C++ compiler sees this, the array is immediately rewritten to be a pointer. This rewriting is so immediate that sizeof and decltype will observe a pointer.
What you probably meant was: boxArray->objectAtIndex( i+j ) = box;