Re: Can add and delete items in coredata, but not change them
Re: Can add and delete items in coredata, but not change them
- Subject: Re: Can add and delete items in coredata, but not change them
- From: "I. Savant" <email@hidden>
- Date: Tue, 18 Apr 2006 11:20:42 -0400
Alexander:
You said before, "it seems the documentation does only explain how
to add or delete but not how to change NSManagedObjects in a coredata
model programmatically."
This is not the case. I believe you could benefit from re-reading
the Core Data Programming Guide as all of this actually is explained
there: http://developer.apple.com/documentation/Cocoa/Conceptual/
CoreData/index.html
The conceptual documentation states that Core Data is built upon
KVO / KVC (key-value observing and key-value coding). Further, when
querying an entity instance's relationships, you must expect an NSSet
(not an NSDictionary), as clearly indicated by the API documentation
in many places.
I strongly recommend thoroughly re-reading the programming guide,
following all references to the technologies upon which it relies
(such as KVO/KVC). Keep re-reading it until you understand it. If
anything about it confuses you, first search Google to see if others
have posted these questions, then if they haven't, post your question
here. You should know, however, that many, many such questions have
already been answered more than once on this very list -- search the
list archives before posting your question..
--
I.S.
On Apr 18, 2006, at 9:27 AM, Alexander Reichstadt wrote:
I was trying to change the properties of instances of entities, I
just found out how, i.e. retrieve a managedObject instance, and
change it using setValue:forKey. What was not obvious to me was
that I would tell an instance of something to commit changes to
itself to something higher up in the hierarchy. Instead I had
something in mind along the lines of a dictionary setValue:forKey:
approach, the dictionary being my data model, the key being the
managed object's unique key, and the value being some dictionary
with the objects properties and values.
Alex
On 18.04.2006, at 14:48, I. Savant wrote:
I'm confused by your wording. Do you mean you want to change the
*properties* of *instances* of *entities* within your *managed
object context*? Or are you trying to programmatically modify the
*managed object model*?
--
I.S.
On Apr 18, 2006, at 8:38 AM, Alexander Reichstadt wrote:
Hi,
it seems the documentation does only explain how to add or delete
but not how to change NSManagedObjects in a coredata model
programmatically.
Does someone have a code snippet that does that I could peek at?
Thanks for any help.
Alex
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com
This email sent to email@hidden
_______________________________________________
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