• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Programmatically adjusting NSValueTransformer of a bound NSTextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Programmatically adjusting NSValueTransformer of a bound NSTextField
      • From: Kiel Gillard <email@hidden>
  • Prev by Date: Re: NSFileManager and Resource Forks
  • Next by Date: No Driver Dependencies
  • Previous by thread: Re: NSFileManager and Resource Forks
  • Next by thread: Re: Programmatically adjusting NSValueTransformer of a bound NSTextField
  • Index(es):
    • Date
    • Thread