Hi I'm trying to add multiple nodes that are the same and assign them different names and then remove one of them when the count gets above 2. All of this works except it is crashing when removing the child by name and returning the error "Invalid Name" can anyone help? I think it is a little different because I am using Sprite Builder and also cocos2d removed "removeChildrenByTag"
-(void)addTowers:(NSTimer *) timer
{
towerCount++;
if (_towerDown.children.count >= 2) {
[_towerUp removeChildByName:@"tower1" cleanup:YES];
towerCount = 0;
}
else
{
//Tower Up
towerUp = [CCBReader load:@"TowerUp"];
towerUp.name = [NSString stringWithFormat:@"tower%d",towerCount];
[_towerUp addChild:towerUp z:1 name:towerUp.name];
}