CoreData transient attribute binding writes but doesn't read

  • - I have an NSTextField bound to an NSObjectController's
    selection.myValue
    - The NSObjectController is set up to use my derived NSManagedObject
    class.
    - The myValue attribute of my entity is transient

    When I type into the NSTextField, my managed object's setMyValue
    method gets called, as it should.

    However, the myValue method doesn't get called. I thought the way MVC-
    bindings worked was that there was supposed to be a round-trip --
    call the setter, then the getter.

    The only time the myValue method is called is when I am loading the
    window.

    Is there any way to trouble-shoot this?

    Dave
  • The problem turned out to be that
    setKeys:triggerChangeNotificationsForDependentKey: was not actually
    causing my derived variable changes to be broadcast. I can't figure
    out why, since the exact same mechanism works in other parts of my code.

    The fix was to observe the independent attributes and call the will/
    didChange methods for the dependent key when the independent
    attributes change.

    I'd still like to know why
    setKeys:triggerChangeNotificationsForDependentKey: doesn't work,
    though. I am on OS 10.4.11.

    Dave

    On Nov 18, 2007, at 7:43 PM, Dave Fernandes wrote:

    > - I have an NSTextField bound to an NSObjectController's
    > selection.myValue
    > - The NSObjectController is set up to use my derived
    > NSManagedObject class.
    > - The myValue attribute of my entity is transient
    >
    > When I type into the NSTextField, my managed object's setMyValue
    > method gets called, as it should.
    >
    > However, the myValue method doesn't get called. I thought the way
    > MVC-bindings worked was that there was supposed to be a round-trip
    > -- call the setter, then the getter.
    >
    > The only time the myValue method is called is when I am loading the
    > window.
    >
    > Is there any way to trouble-shoot this?
    >
    > Dave
previous month november 2007 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    
Go to today