Basic bindings questions
Basic bindings questions
- Subject: Basic bindings questions
- From: Steve Weller <email@hidden>
- Date: Tue, 12 Jul 2005 12:07:49 -0700
I have a simple test application that I am using to explore bindings.
I've done the currency converter tutorials, so I know enough to be
reckless.
I have an NSTextField and an NSSlider on a window. I created an
NSObjectController and hooked it up to my class (Clicker). I use an
instance variable bound to the text field and the slider called
sliderValue.
Questions:
1. The tutorial uses triggerChangeNotificationsForDependentKey: to
trigger a change notification, but I have found that I do not need
that. When I drag the slider and let it go, the text field changes as
expected. If I enable the slider to continuously send actions, that
works too. Why do I not need the
triggerChangeNotificationsForDependentKey?
2. I added a NSButton to the window and added a method clicked: that
doubles the value of sliderValue. I bound the button to the Object
controller with selection.clicked and sure enough my clicked method
is called and sliderValue is doubled each time I click it. However
the text field does not change when the button is clicked. How do I
get the text field to update when sliderValue is changed
programatically?
--
How much art could an artichoke choke if an artichoke could choke art?
_______________________________________________
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