title: NSMutableDictionary removeObjectForKey throwing EXC_BAD_ACCESS for a var that isn't released
body: <p>I have a plist. It has several dozen keys, each with NSMutableArray items:</p>
  
  <pre><code>...
  &lt;key&gt;KeyName1&lt;/key&gt;
  &lt;array&gt;
      &lt;string&gt;String1&lt;/string&gt;
      &lt;string&gt;String2&lt;/string&gt;
      &lt;string&gt;String3&lt;/string&gt;
  &lt;/array&gt;
  
  &lt;key&gt;KeyName2&lt;/key&gt;
  &lt;array&gt;
      &lt;string&gt;String1&lt;/string&gt;
      &lt;string&gt;String2&lt;/string&gt;
      &lt;string&gt;String3&lt;/string&gt;
  &lt;/array&gt;
  ...
  </code></pre>
  
  <p>I have need to remove "String1" for all keys. This is the function that I wrote:</p>
  
  <pre><code>void DeleteString(NSString *StringToDelete){
  NSMutableDictionary *item=nil;  
  
  item = [[NSMutableDictionary alloc] initWithContentsOfFile:filePath];   
  
  for (id obj in item){
      NSString *removeThisObject=(NSString *)obj;
      NSArray *ObjectArray = [item objectForKey:obj];
  
      for (int i = 0; i&lt; [ObjectArray count]; i++){
          NSString *objectString = [ObjectArray objectAtIndex:i];
  
          if([objectString isEqualToString:StringToDelete]){              
              NSLog(@"Remove This from Item Dictionary: %@",removeThisObject);
  
              [item removeObjectForKey:obj];          
          }
      }
  
  }
  [item writeToFile:filePath atomically: YES];
  [item release]; 
  </code></pre>
  
  <p>}</p>
  
  <p>I figured it'd be easier to remove just the entire key if it includes a value that I do not want, but the line: [item removeObjForKey:obj] throws a EXC_BAD_ACCESS. </p>
  
  <p>This does not make sense to me because, as I understand it EXC_BAD_ACCESS means that a message was sent to a released method.</p>
  
  <p>Here, 'item' isn't released is it? I have no error releasing 'item' just a few lines lower.</p>
  
  <p>What is going on here? Is there a better way to remove "String1" from both Keys?</p>
  
  <p>Thanks.  </p>