Core data dependent attributes
Core data dependent attributes
- Subject: Core data dependent attributes
- From: Matteo Manferdini <email@hidden>
- Date: Fri, 26 May 2006 20:32:30 +0200
Hi everyone. I have a data model in core data in which an object has
a numeric attribute that depends on some calculations on attributes
of objects in a to many relationships. I need to keep this attribute
up to date.
If I were using a standard object I know I would have to use KVO, but
I don't know how to do this in core data's managed objects.
Since this attribute depends solely on other attributes, I don't need
to save it. Looking at core data's docs, I think I have to implement
a custom accessor method to compute the value. Is this right?
Moreover, can I use KVO in managed objects, so when the attributes
change the derived attribute will change as well? (somethin like
"Registering dependent keys" in KVO programming guide http://
developer.apple.com/documentation/Cocoa/Conceptual/KeyValueObserving/
Concepts/DependentKeys.html but using attributes of other objects).
One last question: core data programming guide states that I can use
the Xcode data modeling tool to generate the code for accessor
methods for any modeled property. How can I exactly do this?
Thank you very much.
Cheers.
---
Matteo Manferdini
_______________________________________________
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