title: How to make/use temporary NSManagedObjects?
body: <p>Simple, common pattern I can't find in Apple's docs:</p>
  
  <ol>
  <li>Load a coredata store</li>
  <li>Download new data, creating objects
  in memory</li>
  <li>Save <em>some of</em> the new data to the
  store (usually "only the new bits / bits that haven't changed")</li>
  </ol>
  
  <p>Instead, I can find these alternatives, none of which are correct:</p>
  
  <ol>
  <li>Don't create objects in memory
  (well, this means throwing away
  everything good about objects.
  Writing your code using lots of
  NSDictionary's who serve no purpose
  except to workaround CoreData's
  failings. Not workable in general)</li>
  <li>Create objects, but then delete the
  ones you don't want (Apple suggest
  this in docs, but their Notifications go horribly
  wrong: those "deletes" show up when
  you try to save, even though they
  shouldn't / can't)</li>
  <li>Create objects in a secondary
  Context (Apple strongly implies this
  is correct, but apparently doesn't provide any way for
  you to move objects from the temp
  context to the real one, without
  doing the above (deleting objects
  you just created, then doing a
  save). That's not possible in general, because the objects often need to be hooked-up to references in the new context, and a save will fail)</li>
  </ol>
  
  <p>Surely, it shouldn't be this difficult?</p>
  
  <p>If I have to write all the code to manually deep copy an object (by iterating down all of its fields and data structures), why does CoreData exist in the first place? This is a basic feature that CD provides internally.</p>
  
  <p>The only solution I've had working so far is option 2 (from apple's docs), with custom heuristics to "guess" when Apple is sending NSNotifications for objects that should never have been saved in the first place (but Apple sends notofications for anyway). That's a horrible hack.</p>
  
  <p>EDIT: clarification:</p>
  
  <p>I can't figure out how to get Apple's Notifications to be delivered correctly. Apple's code seems to convert insertions into "updates", and convert "temporary objects" into "deletes", etc. I can't listen for "new objects".</p>