Comment éviter les désallocations inutiles? Je suis en ce code:Animer les sprites dans Cocos2d
CCSpriteFrameCache * cache = [CCSpriteFrameCache sharedSpriteFrameCache];
[cache addSpriteFramesWithFile:@"boosttexture.plist"];
CCAnimation * animation = [[CCAnimation alloc] initWithName:@"boosting" delay:1/24.0f];
[animation addFrame:[cache spriteFrameByName:@"ship.png"]];
[animation addFrame:[cache spriteFrameByName:@"ship_boost_l_r.png"]];
id action = [CCRepeatForever actionWithAction:[CCAnimate actionWithAnimation:animation]];
[spaceShipSprite runAction:action];
Lorsque le animaton est en cours d'exécution (accordée - c'est un laid), je reçois ceci dans la console:
2010-04-14 13: 40: 16.311 Booster2K10Beta [521: 20b] cocos2d: désengagement CCSpriteFrame = 00EBA620 | TextureName = 4, Rect = (1,00,32.00,32.00,32.00)
2010-04-14 13: 40: 16.411 Booster2K10Beta [521: 20b] cocos2d: désaffectation CCSpriteFrame = 00EBA620 | TextureName = 4, Rect = (1,00,32.00,32.00,32.00)
2010-04-14 13: 40: 16.496 Booster2K10Beta [521: 20b] cocos2d: désaffectation CCSpriteFrame = 00EBA620 | TextureName = 4, Rect = (1,00,32.00,32.00,32.00)
Il semble inutile que le même SpriteFrame soit libéré 24 fois par seconde - comment éviter cela?