Re: NSUserDefaultsController and enum values vs descriptions
Re: NSUserDefaultsController and enum values vs descriptions
- Subject: Re: NSUserDefaultsController and enum values vs descriptions
- From: Uli Kusterer <email@hidden>
- Date: Sat, 22 Sep 2007 15:26:08 +0200
On 22.09.2007, at 12:51, Stefan Arentz wrote:
Ah yes NSValueTransformer, which does not work for NSTextFields so it
seems my only option there is an NSFormatter?
I wouldn't subclass the NSTextField, though, I'd just write my own
NSValueTransformer-like class. More reusable that way. Maybe you
could even create an NSValueTransformer subclass and just extend it
to work with NSTextFields. Might even be possible to just write a
category that makes NSValueTransformer field-savvy. (Though I'm kinda
surprised: Are you sure the value transformer doesn't work with
NSTextField?)
Anyway, it's way more OO to have a generic object that takes a list
of values and what to display (Maybe an NSDictionary, which you could
even load from a plist file for easier editing), and then you hook
the slider up to that, and that to the text field.
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
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