Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

Thread: Collision Error
View Single Post
Old 03-10-2010, 06:01 PM   #4 (permalink)
OblivianStudios
Registered Member
 
Join Date: Mar 2010
Posts: 14
Default

Quote:
Originally Posted by smasher View Post
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
OblivianStudios is offline   Reply With Quote
 

» Advertisements
» Online Users: 280
19 members and 261 guests
ADY, apatsufas, BdR, ckgni, Duncan C, F_Bryant, glenn_sayers, Guthook, ilmman, joeallenpro, ketaskin, michelle, Music Man, NSeven, Sunny46, VikMyr, vogueestylee, zbynda, ziocleto
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,876
Threads: 89,225
Posts: 380,708
Top Poster: BrianSlick (7,129)
Welcome to our newest member, jorge599
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 08:08 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.