I create a code to simple show and hide a sprite in my screen, this is the code:
CCSprite* pSprite = CCSprite::spriteWithFile(“SpaceFlier_sm_1.png”);
CCSize size = CCDirector::sharedDirector()
>getWinSize;>setPosition( ccp(size.width / 2, - pSprite~~>getContentSize.height / 2) );
CCFiniteTimeAction *seq = CCSequence::actions(
CCMoveTo::actionWithDuration(1.0f, CCPoint(size.width / 2,pSprite~~>getContentSize.height / 2)),
CCMoveTo::actionWithDuration.height / 2)),
But I want to know how I can release the memory, if I uncomment the following line
The sprite don’t appear in the screen.
How I can retain it and release it after the CCMoveTo?