Adding SEL_CallFuncO to a CCArray

Adding SEL_CallFuncO to a CCArray
0.0 0


I need to pass a Array of functions pointers to a function

   SEL_CallFuncO func1 =callfunc_selector(BPBasketLayer::addSingleNumberBasket);
   SEL_CallFuncO func2 =callfunc_selector(BPBasketLayer::addSpawnPowerUp);
   CCArray *arr=CCArray::create();

This gives an error. How am i doing wrong ?


The type of SEL_CallFuncO is

void (CCObject::*)(CCObject*);

it’s a member function pointer, not a CCObject, thus you cannot add it to CCArray.


So if i want to pass a number of number of selectors to a function, what would i do ?

std::vector callbacks;
callbacks.push_back( callfunc_selector( BPBasketLayer::addSingleNumberBasket ) );
callbacks.push_back( callfunc_selector( BPBasketLayer::addSpawnPowerUp ) );