Access CCArray object methods

I have a class which inherits from CCNode. I made a CCArray to hold them all in my MainLayer class. Problem is, I can’t access my class’ methods from CCArray. How do I fix this?

// MyClass.h
#include "cocos2d.h"

class MyClass : public cocos2d::CCNode {
public:
   void doSomething( );
}

// MyClass.cpp
#include "MyClass.h"

void MyClass::doSomething( ) {
   CCLOG( "Method called from CCArray." );
}

//MainLayer.cpp
void MainLayer::fillArray( ) {
   mMyCCArray = CCArray::create( 3 );

   for ( int i = 0; i < mMyCCArray.capacity( ) {
      mMyCCArray -> addObject( new MyClass( ) );
   }
}

void MainLayer::doSomethingWithArray( ) {
   for ( int i = 0; i < mMyCCArray.capacity( ) {
      mMyCCArray -> objectAtindex( i ) -> doSomething( ); // <-- Xcode keeps telling me there is no 'doSomething( )' in that object in a CCArray
   }
}

Any help?

CCArray saved pointer, you need conver CCArray point to your type pointer.
static_cast<MyClass*>(mMyCCArray~~>objectAtIndex)~~>doSomething(); //<- it’s work

Well, giving up on the CCArray idea, I reverted back to std::vector< MyClass >. I will keep that for future use. I wrote too much code already to edit them all.