On Apr 26, 2010, at 11:32, Joanna Carter wrote:

> 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.

Yes, I remember the discussion about this scenario: when the managed object 
represents a *future* permanent resident of the Core Data object graph. Outside 
of a discussion of that scenario, I wouldn't necessarily call this a 
"temporary" object.

In the OP's scenario, there is no suggestion he was trying to keep his 
temporary object out of the user interface. (In fact, his later clarification 
suggests the opposite.) That's why I was asking if the simple create it/delete 
it pattern wouldn't work.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to