removeChildByTag: ребенок не найден. Вот мой код, пожалуйста, помогите! Я довольно новый разработчик с cocos2d, поэтому я не могу понять, что вызывает Xcode, чтобы дать мне эту ошибку.removeChildByTag: child not found error
//Life System
CCSprite *Life3 = [CCSprite spriteWithFile:@"heart.png"];
Life3.position = ccp(210,200);
CCSprite *Life2 = [CCSprite spriteWithFile:@"heart.png"];
Life2.position = ccp(220,200);
CCSprite *Life1 = [CCSprite spriteWithFile:@"heart.png"];
Life1.position = ccp(230,200);
[self addChild:Life3];
[self addChild:Life2];
[self addChild:Life1];
if(Life == 2) {
[self removeChildByTag:Life3];
}
else if(Life == 1) {
[self removeChild:Life2];
[self removeChild:Life3];
}
else if(Life <= 0) {
[self removeChild:Life1];
[self removeChild:Life2];
[self removeChild:Life3];
[[CCDirector sharedDirector] replaceScene:[CCTransitionFade transitionWithDuration:1.0 scene:[MainMenu scene]]];
}
Все еще не работает –
В каком виде? Есть ли другая ошибка, такая же? Если это та же ошибка, найдите свой проект для removeChildByTag и убедитесь, что вы имеете в виду его, а не просто removeChild – Mark
Он работает, он просто не обновляет, я считаю, –