开发者

Cocos2d gameClock update function not working

gameClock is defined the header file

@interface UserInputLayer : CCLayer
{
    ccTime gameClock;
}

In the init method of the layer I have:

[self schedule:@selector(updateClock:)];

updateClock looks like this:

-(void)updateClock:(ccTime)delta {
    gameClock += delta;
 }

but I am getting the error:

Signature not found for selector - does it have the following form? 
-(void)开发者_StackOverflow社区 name: (ccTime) dt


Although I have not used Cocos2D, I would bet that this is because updateClock: is not declared in your header, like this:

@interface UserInputLayer : CCLayer
{
    ccTime gameClock;
}

-(void)updateClock:(ccTime)delta;

@end


Use [self scheduleUpdate] instead.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜