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