Re: How to observe Core Data add/remove actions?
Re: How to observe Core Data add/remove actions?
- Subject: Re: How to observe Core Data add/remove actions?
- From: Joshua Emmons <email@hidden>
- Date: Tue, 13 Nov 2007 19:34:08 -0600
When an object is added or removed, I observe "arrangedObjects.@count"
Why observe @count? Why not observe just arrangedObjects?
which is indeed triggered on add/remove actions. However, when I
read the selected properties, I still get the 'old' selected
properties, not the ones from the new object.
It's not really clear to me what you are doing here. Here are some
general thoughts:
What are the "selected properties" that you are trying to read? Are
they the properties of the entity just added/removed? If so, are you
sure that this entity is, in fact, selected? Array Controllers have a
"Select Inserted Objects" option that may effect this.
Are you trying to read the "selected properties" directly from the
controller or are you using the change dictionary passed to
observeValueForKeyPath:ofObject:change:context:?
Did you give -addObserver:forKeyPath:options:context: any options? All
of those defined in NSKeyValueObservingOptions could effect what
you're trying to do here.
A more concrete example of what you're trying to accomplish (and how
you are trying to accomplish it) could really help us help you.
Cheers,
-Joshua Emmons
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden