Re: Using CoreData as disconnected cache (Populating CoreData programmatically)
Re: Using CoreData as disconnected cache (Populating CoreData programmatically)
- Subject: Re: Using CoreData as disconnected cache (Populating CoreData programmatically)
- From: Andrew Satori <email@hidden>
- Date: Wed, 11 Oct 2006 14:18:28 -0400
You know, sometimes all it takes is a prod :-). Thanks Chris, that's
exactly what I needed. A quick test and it works like a charm.
Andy
On Oct 11, 2006, at 2:05 PM, Chris Hanson wrote:
On Oct 11, 2006, at 9:22 AM, Andrew Satori wrote:
So in order to test this, I've started with the import, and I'm
already stuck. I cannot seem to find any examples of how to add
data to a coredata model programmatically. I can find CoreData
with bindings examples everywhere, but nothing about doing this in
code, and I'm looking for some direction to look for more
information on the subject.
What documentation have you looked at? The Low-Level Core Data
Tutorial <http://developer.apple.com/documentation/Cocoa/Conceptual/
CoreDataUtilityTutorial/> and the Core Data reference documentation
should tell you what you need to know about working with Core Data
persistent stores programmatically.
Also — and I know I mention this in practically every other message
on the subject — it's important to use correct terminology to think
about the problem as it will make both finding answers to your
questions and designing your application a lot easier. I'm
specifically referring to your "add data to a coredata model"
statement. You actually insert managed objects into a managed
object context that is connected to a persistent store coordinator
with any number of persistent stores added to it, and ask the
managed object context to save the changes you've made to your
object graph.
The terminology in the preceding paragraph directly mirrors the
names of the classes you'll need to deal with and the operations
you'll need to ask them to perform. Sometimes developers familiar
with Core Data will speak in shorthand, e.g. "context" instead of
"managed object context" and "coordinator" or "store" instead of
"persistent store coordinator" or "persistent store" but by and
large if you stick to the terms used by the classes, the path to
the solution can sometimes practically chart itself.
-- Chris
_______________________________________________
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