Re: Force NSTextField to update (and transform)
Re: Force NSTextField to update (and transform)
- Subject: Re: Force NSTextField to update (and transform)
- From: mmalc Crawford <email@hidden>
- Date: Sun, 28 Jun 2009 22:00:55 -0700
On Jun 26, 2009, at 5:37 AM, Michał Glenc wrote:
I'm a beginner in Cocoa world and I have some problems with
bindings, NSValueTransformer etc.
Cocoa bindings is not a beginner technology. You are encouraged to
gain some experience with Cocoa before using bindings.
My application performs basic currency transforming. I have two
NSComboBoxes (where I change currency) and two NSTextFields.
Everything works fine, the values get transformed. However, when I
change currency in one of ComboBoxes (after values in TextField have
been already entered), value in TextField stays unchanged. What I
want to achieve is to send the TextField (or perhaps the
NSValueTransformer) a message that it's value has been changed (so
that it retransforms) when the currency in ComboBox is changed.
Could you advise me something?
What value is the combo box changing? If it is simply changing a
value that the value transformer uses, then this will not effect a
change in the text fields. The text fields will only update if the
model value they represent -- or a value upon which the model value
depends -- is updated.
(I may be missing something obvious here, but offhand...) If you had a
controller object that manages the values in the text field and the
exchange rate, then you could make the converted amount dependent on
the values of the source amount and the exchange rate -- you probably
wouldn't need a value transformer, though.
mmalc
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden