
Firstly apologies for my first post being a question, I'm sure it becomes very annoying.
Anywho if you could help me that would be fantastc.
I'm using chipmunk 5.1.0 for my iphone and I've tried to remove the body / shape of an object when its reached a certain point on the screen (When its fallen off the bottom) I'm using this code to catch it :
Code: Select all
if(ball.center.y > self.view.bounds.size.height) {
if(ball.center.y > self.view.bounds.size.height + 10) {
score_int = score_int + 1;
score.text = [NSString stringWithFormat:@"%d",score_int];
cpSpaceRemoveBody(space, ballBody);
cpSpaceRemoveShape(space, ballShape);
[ball removeFromSuperview];
}
}
Code: Select all
Initializing Chipmunk v5.1.0 (Debug Enabled)
Compile with NDEBUG defined to disable debug mode and assert() checks
Assertion failed: (cpArrayContains(space->bodies, body)), function cpSpaceRemoveBody, file /Users/rob/Documents/Iphone Development/Basic Assign Ap/balls Up 0.25/chipmunk/cpSpace.c, line 321.
I also have a cpDataPointer warning about it being an 'invalid receiver type' but I don't think its related to the issue above. I thought it was worth mentioning though!

That occurs on this line of code :
Code: Select all
if([shape->data isKindOfClass:[UIView class]]) {
[(UIView *)shape->data setCenter:CGPointMake(shape->body->p.x, 480-shape->body->p.y)];
}
If you need any more information please don't hesitate to ask, but any help in this issue would be great
