• 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: Populating a new SQLite Core Data store with default data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • RE: Populating a new SQLite Core Data store with default data
      • From: "Jon C. Munson II" <email@hidden>
References: 
 >Populating a new SQLite Core Data store with default data (From: "Jon C. Munson II" <email@hidden>)
 >RE: Populating a new SQLite Core Data store with default data (From: "Jon C. Munson II" <email@hidden>)

  • Prev by Date: Re: Moving oneself to /Applications (or ~/Applications)
  • Next by Date: Re: NSOutlineView : Incorrect Drag and Drop drawing?
  • Previous by thread: RE: Populating a new SQLite Core Data store with default data
  • Next by thread: RE: Populating a new SQLite Core Data store with default data
  • Index(es):
    • Date
    • Thread