This is the code :
for(NSValue *fixtureValue in fixtures)
{
b2Fixture *fixture;
fixture = (b2Fixture*)[fixtureValue pointerValue];
if(contact.fixtureA==fixture && contact.fixtureB == carFixture)
{
NSLog(@"Car hit outersquare!");
[redcar stopAction:moveAction];
_world->DestroyBody(bodyB); // does not destroy body
[self createCarBody];
speed = 0;
break;
}
}
please help...
Where is ‘bodyB’ coming from? You mean
or something like that?
Anyway, I recommend you to use CCBox2D for using Box2D with cocos2d for iphone.