Quote:
Originally Posted by smasher
If you comment out [myTicker invalidate], does it still crash? If so, you're probably invalidating the timer twice. I always set the timer to nil after invalidating it, since [nil invalidate] will do nothing.
|
I invalidate the timer when I pause the game, but then restart it when I un-pasue it.
Pause
Code:
- (IBAction)stop{
[myTicker invalidate];
myTicker = nil;
startButton.hidden = FALSE;
stopButton.hidden = TRUE;
Object.hidden = TRUE;
NAME.hidden = TRUE;
pauseLabel.hidden = FALSE;
//startButton.alpha = 0.5;
time.alpha = 0.5;
timeLabelText.alpha = 0.5;
backgroundImage.alpha = 0.5;
pos = CGPointMake(0.0,0.0);
}
I've tried nullifying it after I invalidate it but it still doesn't work
Un - Pause
Code:
- (IBAction)start{
myTicker = [NSTimer scheduledTimerWithTimeInterval:.09 target:self selector:@selector(showActivity) userInfo:nil repeats:YES];
stopButton.hidden = FALSE;
startButton.hidden = TRUE;
Object.hidden = FALSE;
NAME.hidden = FALSE;
pauseLabel.hidden = TRUE;
time.alpha = 1.0;
timeLabelText.alpha = 1.0;
backgroundImage.alpha = 1.0;
pos = CGPointMake(7.0,3.5);
[NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector (onTimer) userInfo:nil repeats:YES];
[self checkcollision];
}
Thanks
-Oblivian Studios