children_
( )のカウントはCCArray
15を出力し、エラーが発生します。
'NSInternalInconsistencyException', reason: 'index out of range in objectAtIndex(14), index 15'
for (NSInteger i=[children_ count]-1; i>=0; i++) {
CCNode *c = [children_ objectAtIndex:i];
if ([c isKindOfClass:[CCLabelTTF class]]) {
[c removeFromParentAndCleanup:YES];
}
}
これをどのように解決しますか?文字列値を変更するために、すべてのラベルを削除しようとしています。私のCCLayerには、CCMenuItemLabelとCCMenuItemLabelAndSpriteもあります...