Core Data: updating a key dependent on a to-many relationship?
Core Data: updating a key dependent on a to-many relationship?
- Subject: Core Data: updating a key dependent on a to-many relationship?
- From: Nathan Tyler <email@hidden>
- Date: Sun, 29 Jan 2006 11:14:18 -0800
Hi, I have a quick question. I'm a newbie and am struggling with
something that I'm sure an experienced developer can answer in a
couple lines.
I am developing a Core Data application that has an entity with a to-
many relationship with another entity. I need to notify the parent/
single object when its corresponding "many" entities are edited/added/
removed in order to update a total, average, etc. In this case the
triggerChangeNotificationsForDependentKey will not work.
I have found a corresponding section in Apple's Core Data FAQ:
http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/
Articles/cdFAQ.html#//apple_ref/doc/uid/TP40001802-DontLinkElementID_13
This seems to be the exact example of what I need. However, as it is
one of my first endeavors in this area, I need some basic help on:
"You must add and remove the parent as an observer as child objects
are added to and removed from the relationship."
I'm not sure how to do this. The example code shows everything
except how to register the parent (department) as an observer. If
anybody could help me get started it would be a great help as I've
wasted far too much time on what I know is going to be simple in
retrospect.
Thanks,
Nathan
_______________________________________________
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