Re: I don't get how to cast an integer to string
Re: I don't get how to cast an integer to string
- Subject: Re: I don't get how to cast an integer to string
- From: Sherm Pendley <email@hidden>
- Date: Wed, 22 May 2002 08:53:09 -0400
On Wednesday, May 22, 2002, at 08:35 AM, Ted Petrosky wrote:
int j=65;
NSMutableString *aFormattedString = [[NSMutableString alloc]
initWithFormat:@"There are rows"];
[aFormattedString insertString:[j stringValue] atIndex:10];
If you want to interpolate the value of j into your string, why not just
do it with initWithFormat? That's what that method is for; if you didn't
want to interpolate anything into the result, initWithString would be
faster.
[[NSMutableString alloc] initWithFormat: @"There are %i rows.", j];
sherm--
Never put off until tomorrow what you can do today. There might be a law
against it by that time.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.