Re: NSUserDefaultsController and enum values vs descriptions
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