0
\$\begingroup\$

I have 2 events running through time in my game. I want that when gameover starts, this events stops running

This is my code:

- (void)onEnter
{
   [super onEnter];
   [self schedule:@selector(addStars:) interval:1.5];
   [self schedule:@selector(addBoxes:) interval:2.5];

}

-(void)gameOver
{

 //stop schedule addStars
 //stop schedule addBoxes

 }
\$\endgroup\$
-1
\$\begingroup\$

Man, Just do this bellow:

-(void)gameOver
{
   [self unschedule:@selector(addStars:)];
   [self unschedule:@selector(addBoxes:)];
}
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.