• 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: NSString - Initialize with number....
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSString - Initialize with number....


  • Subject: Re: NSString - Initialize with number....
  • From: "Erik M. Buck" <email@hidden>
  • Date: Tue, 2 Oct 2001 14:22:04 -0500

> int foo;
> NSString *fooAsText = [[NSNumber numberWithInt:foo] stringValue];
>
> This should be slightly cheaper than +stringWithFormat:, since there's
> no format to parse.
>

Instead of a string to parse, there two objects to allocate and two
autoreleased. I suspect parsing is much cheaper. Who wants to bench mark
it ?


References: 
 >Re: NSString - Initialize with number.... (From: "John C. Randolph" <email@hidden>)

  • Prev by Date: Re: Docklet(ing) API & 10.1: Where ????
  • Next by Date: SQL databases for Cocoa?
  • Previous by thread: Re: NSString - Initialize with number....
  • Next by thread: Docklet(ing) API & 10.1: Where ????
  • Index(es):
    • Date
    • Thread