任何人都可以回答,我应该改变精灵图像,我用我的功能来做
-(void) openKeyWithSprite:(id) sender withSpriteName:(NSString*)spriteName
这会导致内存泄漏还是可以?
在初始化
_spriteBonus=[CCSprite spriteWithFile:@"monstr_1_1.png"];
按计划进行
-(void) openKeyWithSprite:(id) sender withSpriteName:(NSString*)spriteName
{
CCTexture2D* tex = [[CCTextureCache sharedTextureCache] addImage:spriteName];
[_spriteBonus setTexture: tex];
}