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-09-2010, 09:59 PM   #2 (permalink)
Batman
iPhone SDK learner
 
Join Date: Feb 2010
Location: Illinois, USA
Posts: 417
Default

Quote:
Originally Posted by OblivianStudios View Post
In my app I have to objects colliding. When they do gives me the errors "Program received signals:'EXC_BAD_ACCESS'" and objc_msgSend.
Code:
- (void)checkcollision{
	if(CGRectIntersectsRect(Object.frame, ballImage.frame)){
		
		UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Game Over, Score:" message:time.text delegate:nil cancelButtonTitle:@"Okay" otherButtonTitles:nil];
		[alert show];
		[alert release];
		
		[myTicker invalidate];		
		
		pos = CGPointMake(0.0,0.0);	
		
		
	}
}
But when I remove the UIAlertView so the code is...
Code:
- (void)checkcollision{
	if(CGRectIntersectsRect(Object.frame, ballImage.frame)){
		
		[myTicker invalidate];		
		
		pos = CGPointMake(0.0,0.0);	
		
		
	}
}
I get the error "Program received signals:'SIGABRT'" and _kill

I've read that I'm getting the EXC_BAD_ACCESS and objc_msgSend because the Alert is being deallocated. But the only deallocation I have id the super dealloc at the end.

Thanks

-Oblivian Studios
i've gotten those errors when i test an object that = nil. make sure Object and ballImage do not = nil, and make sure you have allocated and init both.
Batman is offline   Reply With Quote
 

» Advertisements
» Online Users: 835
24 members and 811 guests
ADY, AndreaT, AragornSG, Creativ, Desert Diva, Donovan472, dreamer11, elhanche, elliotbrady, hermi7jami, higgey, ilmman, iphone.savvy, iph_s, jimbo, meandroz, sialcasa, supasounds, TamsiE, Tanya Mir, TTStu, VikMyr, ziocleto
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,864
Threads: 89,223
Posts: 380,687
Top Poster: BrianSlick (7,129)
Welcome to our newest member, elliotbrady
Powered by vBadvanced CMPS v3.1.0

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