I have 3 box2d bodies. All of them have user data. Their userData's tags are shown below.
BODY 1: Tag = 1
BODY 2: Tag = 1
BODY 3: Tag = 2
Further in my code, I have implemented contact listener to detect contacts between bodies and I have put condition that Body 3 will be destroyed either collision between BODY1 and BODY3 or BODY2 and BODY3
But when BODY1 and BODY2 collide with BODY3 at the same time, I am getting EXC_BAD_ACCESS. I know why this error appears : it is because there is no body to remove, as it is removed at first contact.
Anyone know how I can solve this error?