[SOLVED] scheduleOnce callback selector not working

[SOLVED] scheduleOnce callback selector not working
0.0 0


I was having an issue (cocos2d-x v2) where scheduleOnce was not firing the callback method. There were no errors or warnings given, and the program ran fine otherwise. I am not sure why it was not working, possibly because I was calling from within a MyNameSpace, but this is how I got it working.

This was my original call which did not work:
this->scheduleOnce(schedule_selector(MyClassName::myCallbackMethod), 10.0f);

This is how I changed it to get it working:
CCDirector::sharedDirector()->getScheduler()->scheduleSelector(schedule_selector(MyClassName::myCallbackMethod), MyNameSpace::MyClassName::shared(), 2.0, false, 0, 10.0);

Hope this helps somebody.