title: Create a copy of a NSManagedObject
body: <p>I need to temporarily store the content of a <code>NSManagedObject</code> into a dictionary. Because core data has its own memory management procedures, I don't want to keep any strong pointers to the <code>NSManagedObject</code>'s fields, only the values are of interest at this point (values are passed between view controllers, the MOCs are different). I can't create weak pointers either because I want to control when the memory reclaim is done.</p>
  
  <p>I tried a few things, all failed or did not fit the purpose.</p>
  
  <ol>
  <li><p>a duplicate <code>[[myNSMO alloc] initWithEntity:[NSEntityDescription entityForName:entity inManagedObjectContext:myNSMO.managedObjectContext] insertIntoManagedObjectContext:nil];</code>
  It's working, but does not fit into my app design (without getting into details)</p></li>
  <li><p>generate a <code>NSDictionary</code> from the <code>NSManagedObject</code>, using <code>[myNSMO dictionaryWithValuesForKeys:&lt;#(NSArray *)#&gt;]</code>. That's not ok because it returns a dictionary with the addresses of the NSManagedObject fields.</p></li>
  <li><p>create a <code>NSDictionary</code> populating each key-value using a copyWithZone, like this
  <code>[myDictionary setObject:[myNSMO.field copyWithZone:nil] forKey:@"Key"];</code>
  Doesn't work either, I still get the field address...</p></li>
  <li><p>Manually enter each field with
  <code>[myDictionary setObject:[NSString stringWithFormat:@"%@",myNSMO.field ] forKey:@"Key"];</code>
  It's fine this time, I do get new memory allocation. But that's highly time consuming to code this manually...</p></li>
  </ol>
  
  <p>Any chance that someone found clever way to do that? the reason option 1) did not work is because I use the dictionary as a queue. I first store a copy of the object, then pop the entry out when required. A copy of that particular dictionary entry is then returned to the asking method.  The problem is that I can't create a copy of an <code>NSManagedObject</code> that was created using <code>[[...] insertIntoManagedObjectContext:nil];</code></p>
  
  <p>Any solutions?</p>