title: Can't update an NSMutableDictionary value from within a for-in loop?
body: <p>I'm having a weird issue with updating an NSMutableDictionary value. I'm running a for-in loop, everything is retrieved fine, and my math is fine.</p>
  
  <p>The problem lies when I try to update my dictionary with the <code>setValue: forKey:</code> method.</p>
  
  <pre><code>for(NSString *key in self.planetDictionary){
           if(![key isEqualToString:planet]){ 
  
               * * *
              //do some math and stuff, create an NSNumber:
               NSNumber *update = [NSNumber numberWithFloat:updatedProbability];
  
               //Problem code, EXC_BAD_ACCESS here:
               [self.planetDictionary setValue:update forKey:key];
          }
      }
  </code></pre>
  
  <p>I get EXC_BAD_ACCESS crashes. I can confirm everything else is fine, its just the single line where I try to update the value.</p>
  
  <p>What's going on? Thanks</p>