シーケンスの最後にremoveAllChildrenWithCleanup:を追加するまで、正常に機能する変換シーケンスがあります。変換シーケンスを保持し、最後にremoveAllChildrenWithCleanup:を実行するにはどうすればよいですか?
問題のコードのスニペットは次のとおりです。
// Note: spriteSheet is a CCSpriteBatchNode
CCArray *oldSprites = [spriteSheet descendants];
for (int j=0; j < (int)[oldSprites count]; j++) {
CCSprite *sprite = (CCSprite *)[oldSprites objectAtIndex:j];
if (sprite != nil) {
id actionMove = [CCMoveTo actionWithDuration:0.75
position:ccp(0,0)];
[sprite runAction:actionMove];
}
}
[spriteSheet removeAllChildrenWithCleanup:YES];
注:CCMoveTo、CCCallFuncNDのシーケンスを使用してスプライトをクリーンアップしようとしましたが、どちらも機能しません。CCSpriteBatchNodeから子を削除するのは非常に遅いことがわかっているので、removeAllChildrenWithCleanup:を使用しようとしています。