• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to observe Core Data add/remove actions?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • RE: How to observe Core Data add/remove actions?
      • From: Arthur C. <email@hidden>
References: 
 >How to observe Core Data add/remove actions? (From: Arthur C. <email@hidden>)

  • Prev by Date: Re: Change a NSMenu's shape?
  • Next by Date: Re: CALayer question regarding sequence of animations
  • Previous by thread: How to observe Core Data add/remove actions?
  • Next by thread: RE: How to observe Core Data add/remove actions?
  • Index(es):
    • Date
    • Thread