0

我正在开发一个动画应用程序,它使用了 cocosbulder 文件。我正在添加场景,

[[CCDirector sharedDirector] replaceScene:[CCTransitionCrossFade transitionWithDuration:0.5f scene:[CCBReader sceneWithNodeGraphFromFile:@"SongLoadingScene.ccbi"] ]];

它在 iPad1 中生成内存警告。我在每个场景的 dealloc() 中尝试了一些代码。

 -(void)dealloc{

[[CCSpriteFrameCache sharedSpriteFrameCache] removeSpriteFrames];
[[CCSpriteFrameCache sharedSpriteFrameCache] removeUnusedSpriteFrames];
[[CCTextureCache sharedTextureCache] removeUnusedTextures];
[[CCTextureCache sharedTextureCache] removeAllTextures];
[[CCDirector sharedDirector] purgeCachedData];

[super dealloc];
}

它不起作用。加载 5 到 7 个场景后,应用程序收到内存警告并发生崩溃。崩溃发生时它使用大约 500Mb。我怎样才能摆脱这个。

4

0 回答 0