I just downloaded the tutorial sample project and after compiling it for: Device - Debug - SDK 4.2
I got a crash when testing on an ipod touch.
Here is the log:
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/usr/lib/info/dns.so (file not found).
Assertion failed: (selector != __null), function schedule, file /Users/adamjohnston/Desktop/downloads/cocos2d-cocos2d-x-samples-605ee59/Cocos2dxSimpleGame/Cocos2dxSimpleGame/libs/cocos2dx/platform/CCNode_mobile.cpp, line 925.
Program received signal: “SIGABRT”.
The assert is here:
void CCNode::schedule(SEL_SCHEDULE selector, ccTime interval)
{
CCAssert( selector != NULL, "Argument must be non-nil"); //<--- ASSERT
CCAssert( interval >=0, "Argument must be positive");
CCScheduler::sharedScheduler()->scheduleSelector(selector, this, interval, !m_bIsRunning);
}
If we comment the last line, the game runs on the device (but without collisions).
This crash is not happening on the iphone simulator neither the windows simulator.
Can somebody reproduce this error?
hmmm, it seems the problem is the name of the function,
if I change the name of the function HelloWorld::update to HelloWorld::updateGame
the game doesn’t crash in the device. (It was receiving a null pointer)
I suspect issues with c++ multiple inheritance, but I need to check more.
If I modity the 2nd function to void SelectorProtocol::updateMe(ccTime dt); and modify it’s calling in void CCScheduler::tick(ccTime dt) to make compilation successful, then HelloWorld::update will work well on my itouch. Renaming SelectorProtocol::update may affect other classes, so we mustn’t do this.
The inherit relation is: HelloWorld : CCLayerColor : CCLayer : CCNode : SelectorProtocol. I still don’t know why it works correctly on simulator, while crashes on device, why…