我已经知道如何在单视图应用程序中创建计时器,但不知道如何在Spritekit中创建。当我使用以下代码时,出现了两个错误(如下所示)。谁能帮我解决这个问题?谢谢,Jack。
计时器。
错误
计时器。
if(!_scorelabel) {
_scorelabel = [SKLabelNode labelNodeWithFontNamed:@"Courier-Bold"];
_scorelabel.fontSize = 200;
_scorelabel.position = CGPointMake(CGRectGetMidX(self.frame), CGRectGetMidY(self.frame));
_scorelabel.fontColor = [SKColor colorWithHue: 0 saturation: 0 brightness: 1 alpha: .5];
[self addChild:_scorelabel];
}
_scorelabel = [NSTimer scheduledTimerWithTimeInterval: 1 target:self selector:@selector(Timercount)userInfo: nil repeats: YES];
错误
Incompatible pointer types assigned to 'SKLabelNode*' from 'NSTimer*'
Undeclared selector 'Timercount'