NSKeyValueObservingOptionNew broken for NSArrayController: best practice workarounds?
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