Re: NSDictionary and binding
Re: NSDictionary and binding
- Subject: Re: NSDictionary and binding
- From: mmalcolm crawford <email@hidden>
- Date: Wed, 27 Oct 2004 17:05:50 -0700
On Oct 27, 2004, at 4:46 PM, Greg Hurrell wrote:
Unfortunately, I never see
-observeValueForKeyPath:ofObject:change:context: get called when the
CustomView's contents are edited, -setValue: doesn't get called when
the preferences are read in off the disk, and even when I manually
send a -setValue: message to try and trigger something the KVO isn't
happening.
It *sounds* like you're expecting things to work backwards from the way
they do. See the "Joystick" view from the Graphics Bindings example at
<
http://homepage.mac.com/mmalc/CocoaExamples/controllers.html>.
It might be appropriate to write a value transformer to convert to/from
a dictionary from/to your custom class.
In the current implementation I can tell the CustomView to display the
ComplexObject by using the -value and -setValue: accessors as shown
below. I choose "value" because it seemed consistent with the
conventions, but I've also tried other names and it doesn't work.
There does not have to be a 1:1 correspondence between binding names
and instance variable names. See
<
http://developer.apple.com/documentation/Cocoa/Conceptual/
CocoaBindings/Concepts/HowDoBindingsWork.html>, which also gives a
complete conceptual overview of how to write a bindings-enabled view.
mmalc
_______________________________________________
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