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.
精彩评论