• 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: 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


  • Follow-Ups:
    • Re: NSUserDefaultsController and enum values vs descriptions
      • From: "Stefan Arentz" <email@hidden>
References: 
 >NSUserDefaultsController and enum values vs descriptions (From: "Stefan Arentz" <email@hidden>)
 >Re: NSUserDefaultsController and enum values vs descriptions (From: "Stefan Arentz" <email@hidden>)

  • Prev by Date: Re: really weird move file problem - copy fails also, more datapoints
  • Next by Date: Re: NSUserDefaultsController and enum values vs descriptions
  • Previous by thread: Re: NSUserDefaultsController and enum values vs descriptions
  • Next by thread: Re: NSUserDefaultsController and enum values vs descriptions
  • Index(es):
    • Date
    • Thread