• 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
How do I populate Tiger's Core Data via NSSQLiteStoreType; programatically?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How do I populate Tiger's Core Data via NSSQLiteStoreType; programatically?


  • Subject: How do I populate Tiger's Core Data via NSSQLiteStoreType; programatically?
  • From: "Frederick C. Lee" <email@hidden>
  • Date: Mon, 16 May 2005 11:39:32 -0700

Greetings:
I wish to use SQLite in storing vector data for rapid I/O when drawing a screen versus using objects. This isn't meant for UI I/O back back-end I/O.


1) I've added a NSManagedObjectContext via XCode's .xcdatamodel and drew out my tables and their relationships.
2) I would like to quickly populate these tables and their dependencies and also extract data too. I'm thinking in SQL vs Key- Value terms.


My questions:

1) Is Core Data (NSManagedObject, etc.) the more-efficient way to do such mathematical I/O vs 'objects in the MVC sort of way'?
- On the surface, it appears to be a more-intuitive way coming from a SQL/fetch background (Oracle).


2) How do I populate a parent/daughter set of tables ("3rd Normal Form" in DB parlance) programmatically?
- Do I access the NSManagedObject directly?


-------------
Here is how I can glean the 'name' attribute of the 'Table' (NSManagedObject) 'name':


(gdb) po [[[shapeObjectsModel entitiesByName] objectForKey:@"Shape"] name] // Name of 'Table"
Shape


And the following are the properties {attributes ('fields') and relationships ('keys')}:
(gdb) print (int) [[[[shapeObjectsModel entitiesByName] objectForKey:@"Shape"] properties] count]
$1 = 9


(gdb) po [[[[shapeObjectsModel entitiesByName] objectForKey:@"Shape"] properties] objectAtIndex:0] // Sample of one property as a member of a NSArray.
(NSAttributeDescription), name name, isOptional 0, isTransient 0, entity Shape, validation predicates (), warnings (), attributeType 700 , attributeValueClassName NSString, defaultValue (null)
--------------


So I'm getting lost here: How do I programatically populate the tables of my 'NSManagedObjectContext' {'database'}?

An Example would be excellent!

Regards,
Ric.

P.S. a simple FETCH example would be great, too!


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: How do I populate Tiger's Core Data via NSSQLiteStoreType; programatically?
      • From: mmalcolm crawford <email@hidden>
  • Prev by Date: Re: NSSocketPort question: retainCount
  • Next by Date: Re: Binding to an array.name, how?
  • Previous by thread: Re: Drawing content in NSTableView Cells
  • Next by thread: Re: How do I populate Tiger's Core Data via NSSQLiteStoreType; programatically?
  • Index(es):
    • Date
    • Thread