开发者

how to remove timer

i have this timer

[NSTime开发者_开发问答r scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(updateTimerFunc) userInfo:nil repeats:YES];

and on some function i want to completly remove this...how?


You should not use NSTimer in Cocos2d, instead you should do:

[self schedule:@selector(updateTimerFunc) interval:1.0];

And to remove it:

[self unschedule:@selector(updateTimerFunc)];

or:

[self unscheduleAllSelectors];

If you have an update-function you could use: [self scheduleUpdate];

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜