Removing bodies from the world

I'm pretty new to the box2D iphone thing, so bear with me please.

Basically I'm creating an Orange Machine, whose sole purpose is managing the creating and (ultimate) destruction of all oranges. This class has a NSMutableArray full of Orange(CSSprite) objects. It's been easy to add oranges to the world, I'm just wondering how I would go about removing them from the world.

I've googled quite a bit and haven't been able to locate anything useful (maybe I need to hone my google-fu.)

So basically I need guidance. Not necessarily code; but general process type information. (and method names always help 😀 )

So my questions are:

Question: how would I go about getting a body belonging to a world from a certain location in the world removed from said world?
Have you tried world->destroyBody(body)?

From the incomplete Box2D reference:
Quote:
void b2World::DestroyBody ( b2Body * body)

Destroy a rigid body given a definition.

No reference to the definition is retained. This function is locked during callbacks.

Warning:
This automatically deletes all associated shapes and joints.

This function is locked during callbacks.
I had, but it hadn't worked before. I realized the debugger was giving me problems elsewhere. I've got destruction working well now.

New problem (that maybe I could get some help with):

I have it set so that when I touch an orange, it deletes it. Well, if I touch repeatedly too fast I get a EXEC_BAD_ACCESS error, which I think is being fired by it finding an orange on both touches, but it deleting it before the second touch has completed.

What would be a good way to go about checking if the orange is available for deletion? (Im thinking Im going to shove a bool in there called taggedForDeletion).

Thanks for any and all help,
Ozzadar

Original thread: https://box2d.org/forum/viewtopic.php?t=6685