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



On Tuesday, October 2, 2001, at 04:31 AM, Ryan Dary wrote:

How do I create a new NSString with a textual representation of a number
from an int?

int foo;
NSString *fooAsText = [[NSNumber numberWithInt:foo] stringValue];

This should be slightly cheaper than +stringWithFormat:, since there's no format to parse.

-jcr


"I fear all we have done is to awaken a sleeping giant and fill him with a terrible resolve." -Admiral Isoroku Yamamoto, Dec 7, 1941.


References: 
 >NSString - Initialize with number.... (From: Ryan Dary <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.