Quote:
Originally Posted by OblivianStudios
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.