• 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
NSKeyValueObservingOptionNew broken for NSArrayController: best practice workarounds?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSKeyValueObservingOptionNew broken for NSArrayController: best practice workarounds?


  • Subject: NSKeyValueObservingOptionNew broken for NSArrayController: best practice workarounds?
  • From: Mailing list subscriptions <email@hidden>
  • Date: Thu, 5 Oct 2006 18:25:12 +0200

I've seen many threads about the change dictionary in observeValueForKeyPath:ofObject:change:ontext: returning NULL values when NSKeyValueObservingOptionNew or NSKeyValueObservingOptionOld is passed to the addObserver:forKeyPath:options:context: of NSArrayController.

But after looking at dozens (hundreds even) of messages all I can see is, "it's a known bug since way back in the Panther days", but not any workarounds.

What's the best workaround for this, then?

- subclass NSArrayController and override the KVO methods until I fix the breakage (not exactly sure how far I'd need to go with that)

- in my observer keep a record of the "last known state" and then compare it against the new state whenever a notification is received (ie manually figure out what changed)

- some sort of willChange/didChange trickery (did experiment with this but didn't cure the problem)

Any ideas? I'm going to go with the "last known state" trick for now but if there's a better way I'd like to know about it. Thanks in advance.

_______________________________________________
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


  • Follow-Ups:
    • Re: NSKeyValueObservingOptionNew broken for NSArrayController: best practice workarounds?
      • From: Mailing list subscriptions <email@hidden>
    • Re: NSKeyValueObservingOptionNew broken for NSArrayController: best practice workarounds?
      • From: John Terranova <email@hidden>
  • Prev by Date: Core Animation Sample Code
  • Next by Date: Re: Core Animation Sample Code
  • Previous by thread: Re: Core Animation Sample Code
  • Next by thread: Re: NSKeyValueObservingOptionNew broken for NSArrayController: best practice workarounds?
  • Index(es):
    • Date
    • Thread