Re: Populating a new SQLite Core Data store with default data
Re: Populating a new SQLite Core Data store with default data
- Subject: Re: Populating a new SQLite Core Data store with default data
- From: mmalc Crawford <email@hidden>
- Date: Mon, 23 Feb 2009 09:06:26 -0800
On Feb 23, 2009, at 6:37 AM, Jon C. Munson II wrote:
When the -insert method is called, Core Data creates an instance of
a new
object for an entity and returns a pointer to that object. [...]
This is described in the documentation:
<http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdCreateMOs.html
>
By calling -setValue:forKey: one can then fill in the data values
for the required
attributes.
The documentation makes clear that you should typically *not* use key-
value coding to set managed objects' attribute values:
<http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdUsingMOs.html#//apple_ref/doc/uid/TP40001803
>
This is different from using default values for attributes as
set by either the data model or via equivalent code. Those default
values
will be automatically populated when the object is created.
<http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdManagedObjects.html#//apple_ref/doc/uid/TP40003397-SW2
>
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