title: Remove keys/values from nsdictionary
body: <p>I am trying to convert my coredata to json, I have been struggling to get this to work but have found a way that is almost working.</p>
  
  <p>my code:</p>
  
  <pre><code>NSArray *keys = [[[self.form entity] attributesByName] allKeys];
          NSDictionary *dict = [self.form dictionaryWithValuesForKeys:keys];
          NSLog(@"dict::%@",dict);
  
          NSError *error;
          NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dict
                                                             options:NSJSONWritingPrettyPrinted // Pass 0 if you don't care about the readability of the generated string
                                                               error:&amp;error];
  
          if (! jsonData) {
              NSLog(@"Got an error: %@", error);
          } else {
              NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
              NSLog(@"json::%@",jsonString);
          }
  </code></pre>
  
  <p>also "form" is:</p>
  
  <pre><code> @property (strong, retain) NSManagedObject *form;
  </code></pre>
  
  <p>This works fine except I have NSIndexSet saved in some of the coredata attributes. This poses a problem with the JSON write. Now, my indexsets do not need to be converted to json so I was wondering if there was a way to delete all indexes from the dict? or maybe there is a better way to do this I am unaware of.</p>
  
  <p>here is part of the nslog of dict:</p>
  
  <pre><code>...
      whereExtent = "";
      wiring =     (
      );
      wiring1 = "&lt;NSIndexSet: 0x82b0600&gt;(no indexes)";
      wiringUpdated = "&lt;null&gt;";
      yardFenceTrees = "&lt;null&gt;";
  }
  </code></pre>
  
  <p>so in this case I want to remove "wiring1" from dict but need to be able to do it in a "dynamic" way (not using the name "wiring1" to remove it)</p>