I have a class object with multi object :
@
spritebatch = CCSpriteBatchNode::create("Blue.pvr"); m_pSprite1 = CCSprite::createWithSpriteFrameName("Blue_1.png"); m_pSprite1->setPosition(CCPoint(300.0f, 200.0f)); spritebatch->addChild(m_pSprite1); m_Layer->addChild(spritebatch);
CCArray *idleAnimFrames = CCArray::createWithCapacity(10);
idleAnimFrames~~>retain;
for
{
CCSpriteFrame frame = CCSpriteFrameCache::sharedSpriteFrameCache~~>spriteFrameByName~~>getCString);
idleAnimFrames~~>addObject;
}
CCAnimation idleAnimation = CCAnimation ::createWithSpriteFrames) ;
CCArraybigAnimFrames = CCArray::createWithCapacity;
bigAnimFrames~~>retain;
for
{
CCSpriteFrameframe = CCSpriteFrameCache::sharedSpriteFrameCache~~>spriteFrameByName~~>getCString);
idleAnimFrames~~>addObject;
}
CCAnimation *bigAnimation = CCAnimation ::createWithSpriteFrames) ;
this~~>m_actionIdle = CCRepeatForever::create);
this~~>m_actionBigger = CCRepeatForever::create(CCAnimate::create(bigAnimation));
m_pSprite1->runAction(m_actionIdle);
Init();
@
In touch method of helloworldscence
`@ CCTouch* touch = (CCTouch*)( touches->anyObject() );
CCPoint location = touch->getLocationInView();
location = CCDirector::sharedDirector()->convertToGL(location);
if(m_BlueBall->getRect(location))
{
m_BlueBall->m_pSprite1->stopAction(m_actionIdle);
m_BlueBall->m_pSprite1->runAction(m_actionBigger);
}
// Set up initial location of projectile
CCSize winSize = CCDirector::sharedDirector()->getWinSize();
`
@
Animation Idle run normally, but when i touch to call second animation, error:" thread 1: signal SIGABRT" in :
@ void CCObject ::retain(void) CCASERT(m_uReference > 0, "reference count should greater than 0 ");
@