• 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
Re: NSUserDefaultsController and enum values vs descriptions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSUserDefaultsController and enum values vs descriptions


  • Subject: Re: NSUserDefaultsController and enum values vs descriptions
  • From: "Stefan Arentz" <email@hidden>
  • Date: Sat, 22 Sep 2007 12:51:06 +0200

On 9/22/07, Stefan Arentz <email@hidden> wrote:
> I have hooked up a slider with a range of 1-5 to the
> NSUserDefaultsController. I see the value appear in the preferences
> file and I also see the numeric value appear in a  (non editable)
> NSTextField that I bound to the same value.
>
> So this works great but I don't want to show the numeric value of the
> slider in the text field. Instead I want to translate it to a
> description. Is there a way to transform the value when it is pushed
> out to the text field? Or do I have to subclass the textfield and
> override it's setIntValue: method?
>
> What is the Cocoa way to do this?

Ah yes NSValueTransformer, which does not work for NSTextFields so it
seems my only option there is an NSFormatter?

 S.
_______________________________________________

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: NSUserDefaultsController and enum values vs descriptions
      • From: Uli Kusterer <email@hidden>
References: 
 >NSUserDefaultsController and enum values vs descriptions (From: "Stefan Arentz" <email@hidden>)

  • Prev by Date: NSUserDefaultsController and enum values vs descriptions
  • Next by Date: Re: Question about scope of "convenience objects"
  • Previous by thread: NSUserDefaultsController and enum values vs descriptions
  • Next by thread: Re: NSUserDefaultsController and enum values vs descriptions
  • Index(es):
    • Date
    • Thread