• 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: Appropriate Use of NSFormatter?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Appropriate Use of NSFormatter? (From: Jericho Hasselbush <email@hidden>)
 >Re: Appropriate Use of NSFormatter? (From: Keary Suska <email@hidden>)

  • Prev by Date: Re: Appropriate Use of NSFormatter?
  • Next by Date: Re: Appropriate Use of NSFormatter?
  • Previous by thread: Re: Appropriate Use of NSFormatter?
  • Next by thread: Re: Appropriate Use of NSFormatter?
  • Index(es):
    • Date
    • Thread