Hi,
kicks for the newbie only accepted with hints to my problem ^^
I have a CCNode subclass that perfectly works in a new cocos2dx environment. However, I want to detect touches and handle them in that class. Hence, I inherited the class in addition from CCTargetedTouchDelegate and added and implemented
virtual bool ccTouchBegan(cocos2d::CCTouch* touch, cocos2d::CCEvent* event);
and also tried to register itself as a delegate in
void MyNode::onEnter()
{
CCDirector::sharedDirector()->getTouchDispatcher()->addTargetedDelegate(this, 0, true);
CCNode::onEnter();
}
Starting from that moment, application starts fail.
I’m using the current cocos2dx version, the starting fails on line 92 of CCObject:
void CCObject::retain(void)
{
CCAssert(m_uReference > 0, "reference count should greater than 0"); //HERE
++m_uReference;
}
I cannot get a hint why it fails then, it looks like it fails as soon as I add the register addTouchDelegate.
Any hint is highly appreciated.
Thx in advance
Thorsten