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 (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com