Re: Adding new Core Data objects through a form
Re: Adding new Core Data objects through a form
- Subject: Re: Adding new Core Data objects through a form
- From: mmalc Crawford <email@hidden>
- Date: Wed, 28 Oct 2009 09:01:37 -0700
On Oct 28, 2009, at 6:26 am, Martin Cote wrote:
> That said, the situation in this sample project is quite different.
> When they add an object, they actually add an empty object in an array
> controller.
>
This is precisely what the example does not do.
<http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/NSPersistentDocumentTutorial/08_CreationSheet/creationSheet.html#//apple_ref/doc/uid/TP40001799-CH284-SW2>
It creates a separate managed object context to allow a discrete set of edits to be made that don't affect the array controller or the document's main context (which avoids "questions about other parts of your app—like entity mode array controllers—dealing with this transient object being created"). The significant advantage of using an actual managed object is that you can then leverage bindings to invoke its native validation methods, ensuring consistency of business logic.
mmalc
_______________________________________________
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