title: Avoiding "NSArray was mutated while being enumerated"
body: <p>I have an <code>NSMutableArray</code> that stores mousejoints for a Box2d physics simulation. When using more than one finger to play I'll get exceptions stating </p>
  
  <blockquote>
    <p>NSArray was mutated while being enumerated</p>
  </blockquote>
  
  <p>I know this is because I'm deleting objects from the array while also enumerating through it, invalidating the enum. </p>
  
  <p>What I want to know is what is the best strategy to solve this going forward? I've seen a few solutions online: <code>@synchronized</code>, copying the array before enumerating or putting the touch joint into a garbage array for later deletion (which I'm not sure would work, because I need to remove the mousejoint from the array straight after removing it from the world). </p>