Re: newbie bindings question
Re: newbie bindings question
- Subject: Re: newbie bindings question
- From: Jens Miltner <email@hidden>
- Date: Tue, 3 May 2005 12:34:48 +0200
Am 03.05.2005 um 12:29 schrieb j h:
Hi,
I am trying to learn about bindings (I have run the
currency tutorial using bindings) but I am having a
little difficulty, perhaps someone can help?
I have a demo app which has a slider bar and a text
box, and the bindings are set up so that when either
the data in the text box is changed or when the slider
is changed, the binding will deal with this.
(I have this bit working ok)
However, I would also like a method / function to be
called when the key changes, but I'm not sure how to
do this. Can some one help (or at least point to the
documentation which may be able to help as I'm a
little confused!)
Two options:
(1) observe the value being changed using the
observeValueForKeyPath:ofObject:change:context: API (see
NSKeyValueObserving protocol documentation). That way you'll get
notified whenever the value is changed in KVC compliant ways (e.g. by
your bindings).
(2) implement an IBAction and connect it as the target action for both
the slider and text box. That way you'll be called when the user
changes either of them.
</jum>
_______________________________________________
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