• 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: Number Formatter Default Value (or combo box?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Number Formatter Default Value (or combo box?)


  • Subject: Re: Number Formatter Default Value (or combo box?)
  • From: Seth Willits <email@hidden>
  • Date: Fri, 15 Mar 2013 21:29:53 -0700

On Mar 15, 2013, at 6:38 PM, Quincey Morris wrote:

>> Am I wrong on that? I don't think I am, so I guess I'll keep on trucking with the above code.
>
> The only thing that springs to mind is that *perhaps* it's more correct to think of the formatter as a validator of input structure, rather than of input values...

I had the same thoughts. The KVC validation path popped into my mind, but code-wise it's a bit more of a nuisance, particularly with user defaults as you mentioned.


> FWIW, my personal preference is never to bind directly to NSUserDefaults, for exactly this kind of reason. I prefer to put boilerplate code (into, say, the app delegate) to do the mediation, so that I can intervene into the touching of user defaults as and when required.

It seems like a subclass of NSUserDefaultsController could be useful — get all the free standard behavior but easily be able to handle a few things differently. Unfortunately it doesn't seem there's any way to get [NSUserDefaultsController sharedUserDefaultsController] to return an instance of a subclass which makes the idea less convenient and more prone to mistakes from using the wrong one. Hmm.


--
Seth Willits


_______________________________________________

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


References: 
 >Number Formatter Default Value (or combo box?) (From: Seth Willits <email@hidden>)
 >Re: Number Formatter Default Value (or combo box?) (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Number Formatter Default Value (or combo box?)
  • Next by Date: Global (all-user) preferences for an application
  • Previous by thread: Re: Number Formatter Default Value (or combo box?)
  • Next by thread: Global (all-user) preferences for an application
  • Index(es):
    • Date
    • Thread