Programmatically adjusting NSValueTransformer of a bound NSTextField
Programmatically adjusting NSValueTransformer of a bound NSTextField
- Subject: Programmatically adjusting NSValueTransformer of a bound NSTextField
- From: Kiel Gillard <email@hidden>
- Date: Wed, 27 Oct 2010 15:45:56 +1100
Hi all,
Can you please look at this very small and rough reproduction of my problem <http://dl.dropbox.com/u/1064994/cocoadev bindings.zip>.
I want to present measured values of my model with respect to the user's locale. For example, I want to present a distance in imperial units of measurement instead of metric. I am using NSValueTransformer subclasses to transform the units of my model into imperial or metric units.
When I receive a notification indicating the user's measurement locale changes in System Preferences, my code unbinds and re-binds the value binding of a text field to an instance variable of the controller. I provide the appropriate value transformer in the options of the binding.
I was wondering if you could please help me with my problem. My NSTextField object is not editable when the change in system locale causes the text field to use a value transformer different from the initial. Specifically, the binding is configured in Interface Builder to use the metric value transformer but when I use System Preferences to adjust my locale preferences to use an imperial (U.S.) system, my text field becomes unchangeable. Adjusting the locale preferences to use a metric system re-enables my text field for editing.
Any thoughts, comments or suggestions would be extremely helpful and appreciated!
Kiel
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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