Re: Appropriate Use of NSFormatter?
Re: Appropriate Use of NSFormatter?
- Subject: Re: Appropriate Use of NSFormatter?
- From: Alastair Houghton <email@hidden>
- Date: Sun, 29 Nov 2009 21:48:31 +0000
On 29 Nov 2009, at 20:55, Keary Suska wrote:
> Probably better to use an NSValueTransformer, which gives you reverse transformation as well.
So does NSFormatter, FWIW. It's the "old school" way to do this kind of thing.
That said, I wouldn't make a custom NSFormatter that uses a global variable. Rather, I'd make a global instance of a custom NSFormatter, and use that. Or make an NSFormatter that happens to be a singleton of some sort. Anyway, you get the idea.
I'm honestly not sure as to the benefits of NSFormatter versus NSValueTransformer for this application. NSValueTransformer is really intended for use with bindings, so if you aren't using bindings then NSFormatter is probably the way to go, but otherwise... I'd be interested to hear any opinions anyone else has.
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
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