How do I populate Tiger's Core Data via NSSQLiteStoreType; programatically?
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