分数标签显示值覆盖

当分数更新时,新的分数值标签会覆盖显示器上的旧分数值,因为这个分数是不可读的,所以如何更新新分数? 这里我得到了什么:

SKLabelNode *ScoreLabel; NSInteger score = 0; ----------------------------- -(void)Scoring{ score = score +1; ScoreLabel = [SKLabelNode labelNodeWithFontNamed:@"Arial"]; ScoreLabel.position = CGPointMake(CGRectGetMidX(self.frame), 960); ScoreLabel.text = [NSString stringWithFormat:@"%ld",(long)score]; [self addChild:ScoreLabel]; } 

每添加一个新标签,最后都会添加。 改变这样的代码:

 -(void)Scoring{ score = score +1; if (ScoreLabel == nil) { ScoreLabel = [SKLabelNode labelNodeWithFontNamed:@"Arial"]; ScoreLabel.position = CGPointMake(CGRectGetMidX(self.frame), 960); [self addChild:ScoreLabel]; } ScoreLabel.text = [NSString stringWithFormat:@"%ld",(long)score]; }