Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSString - Initialize with number....



> 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>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.