我有这个代码:
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:temp/10.0f
target:self
selector:@selector(verify)
userInfo:nil
repeats:YES];
CCMoveTo *moveTo = [CCMoveTo actionWithDuration:temp position:positionX];
id doneAction = [CCCallFuncN actionWithTarget:timer selector:@selector(invalidate)];
id sequence = [CCSequence actions: moveTo, doneAction, nil];
[self.container runAction:sequence];
问题是计时器没有失效并在动画结束后继续运行。
我错过了什么?
谢谢。