• 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: Dumb question about Core Data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dumb question about Core Data


  • Subject: Re: Dumb question about Core Data
  • From: Dave Carrigan <email@hidden>
  • Date: Thu, 4 Feb 2010 17:40:32 -0800

On Feb 4, 2010, at 5:13 PM, William Squires wrote:

> Let's say I have an entity, "Player" that has some attributes (Name, Level, XP, FightStr, DefenseStr, etc...) for a role-playing game. How do I pre-initialize an entity with known values, when their properties are @dynamic? I need for a "blank" player to start out on level 1 with 0 XP, 0 FightStr, and 0 DefenseStr, and a name of "<Blank>". I can get Xcode to generate the class files (Player.m and Player.h), but then I'm at a loss. I understand that the entity is tied to the data store (SQLite 3 database, or XML, or a binary file), but short of using XML and an ugly hack to pre-load the XML file, I can't see a reasonable way to accomplish this seemingly common task.


You can set default values for all properties in the data modeler. Or am I mis-understanding your question?

--
Dave Carrigan
email@hidden
Seattle, WA, USA

_______________________________________________

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

References: 
 >Dumb question about Core Data (From: William Squires <email@hidden>)

  • Prev by Date: Re: Implementing NSOutlineView datasource methods when using an asynchronous source?
  • Next by Date: close sheet with app hidden
  • Previous by thread: Dumb question about Core Data
  • Next by thread: Re: Dumb question about Core Data
  • Index(es):
    • Date
    • Thread