Re: NSString - Initialize with number....
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 ?