• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Creating temporary NSManagedObjects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating temporary NSManagedObjects


  • Subject: Re: Creating temporary NSManagedObjects
  • From: Joanna Carter <email@hidden>
  • Date: Mon, 26 Apr 2010 19:32:58 +0100

Hi Quincey

> Notwithstanding the discussion in this thread so far, I don't quite understand why you wouldn't do this the easy way: create a NSManagedObject in your managed context, and delete it when you're done with it.


If you are editing a list of objects, using a NSTableView, then one reason why you might not want to create temporary objects in the main context is that those objects get displayed in the NSTableView, even though you might not want them to be visible until the editing is finished.

If you work with the trick of using a secondary context for editing, then you have to manage the copying of property values to/from the temporary object, including relationships, which have to be resolved from the original context.

Which is why I use a temporary dictionary, because it allows me to freely interact with the property values, including relationships, without the need to work with a secondary context, as well as not affecting any UI components that might be displaying the original list.

Joanna

--
Joanna Carter
Carter Consulting

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Creating temporary NSManagedObjects
      • From: Quincey Morris <email@hidden>
References: 
 >Creating temporary NSManagedObjects (From: vincent habchi <email@hidden>)
 >Re: Creating temporary NSManagedObjects (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: [iPhone] File coping application
  • Next by Date: Re: Creating temporary NSManagedObjects
  • Previous by thread: Re: Creating temporary NSManagedObjects
  • Next by thread: Re: Creating temporary NSManagedObjects
  • Index(es):
    • Date
    • Thread