Re: NSKeyValueChangeNewKey returning NSNull, partially solved

  • > On Dec 24, 2007, at 5:14 AM, Kai BrĂ¼ning wrote:
    >
    >>> have you considered implementing manual KVO notifications for the setter?
    >>
    >> I did consider it, but didn't try it (yet) because I *am* getting the changed notification, just with an - in my opinion - incorrect change dictionary.
    >>
    >> But I at least partially solved the problem in the meantime: the observed class (class of objectToObserve below) was based upon NSController. When I change this to NSObject, everything works.
    >>
    >> I guess that NSController modifies automatic KVC/KVO in some way. I did not find anything in that direction in the docs so far, but that of course does not mean that it is not documented somewhere. I'll check whether NSController overrides any of the KVC/KVO control methods when I find the time.
    >>
    >> Nevertheless, a word by somebody in the know would be appreciated.
    >
    > Kai,
    >
    > I'm coming to this thread late, so you may already have an answer.
    > Though not official Apple documentation, mmalc's Bindings examples page says it's a bug in NSController that the change dictionary always has a nil value.
    >
    > Goto < http://homepage.mac.com/mmalc/CocoaExamples/controllers.html > , do a text search for "bug".
    >
    > In my experience, you're informed of the kind of change that occurred (insertion/removal), but the old and new values are always nil.

    That is my experience, too.

    >
    > Bill

    Thanks a lot, Bill, this saves me further headaches and investigation. I filed rdar://5672130 requesting to document this behavior.

    Kai
previous month january 2008 next month
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Go to today