Hi, I would like to know how can i disable a schedule using cocos2d?
How to disable a schedule?
(4 posts) (4 voices)-
Posted 2 years ago #
-
// Schedule a method
[self schedule:@selector(myMethod) interval:1];// MyMethod
-(void) myMethod
{
// Unschedule the selector
[self unschedule:@selector(myMethod)];
// Do your business
}Posted 2 years ago # -
how do you pause a schedule or restart one?
Posted 2 years ago # -
[self unschedule:@selector(myMethod)];terminates the scheduler, you can't pause a scheduler, nor can you pause an NSTimer...I heard about another method, calling
- (void)onEnterand-(void)onExitWhich pauses the whole Scene/Layer, so you might wanna search for that thread, I head it works quite well...Posted 2 years ago #
Reply
You must log in to post.