The source code below hasn’t been compiled and tested.
class MyObject : public CCObject
void checkBGMusicPlaying(float dt)
CCDirector::sharedDirector()->getSheduler()->scheduleSelector(schedule_selector(MyObject::checkBGMusicPlaying), this, 0, false);
// Use it as a global variable
We can do this because the minimal for CCScheduler is CCObject. I said CCNode in the previous post, but now I check the source code, CCObject is enough.
What you want is just a timer callback from CCScheduler.