schedule_selector crashes device

schedule_selector crashes device
0.0 0


While our code runs perfectly fine on the simulator, on the iphone schedule_selector crashes. Specifically the following line:

SEL_SCHEDULE var = (SEL_SCHEDULE)(&GameStaticLayer::update);
schedule(var, 0);


(gdb) print var
$1 = {
*pfn = 0,
*delta = 1

That is, the function pointer to update is NULL which crashes schedule eventually due to one of the asserts. The update function is defined and declared correctly and the code runs perfectly on the iphone simulator. I don’t see how I could be possibly getting a bad function pointer. Any tips will be greatly appreciated.


Is it crashed after CCDirector::sharedDirector()->end() invoking? For example, you call CCDirector::end() in a schedule or action callback?


Faced with same problem on iPhone device(and only on it, win32&android works fine) :slight_smile:

Since GameStaticLayer derived from SelectorProtocol (GameStaticLayer->CCLayer->CCNode->SelectorProtocol) problem in name of method GameStaticLayer::update
which collided with update method of SelectorProtocol

I hope this will help you :slight_smile: