Re: Int to String
Re: Int to String
- Subject: Re: Int to String
- From: Lorenzo <email@hidden>
- Date: Wed, 09 Jul 2003 10:29:27 +0200
Hi,
just do this:
int theInteger = 512;
NSString *theString = [NSString stringWithFormat:@"%d", theInteger];
and you will get theString = @"512";
you can print the string on the console with:
NSLog(@"My string is %@", theString);
you can print the integer on the console with:
NSLog(@"My integer is %d", theInteger);
More, if you use
theString = [NSString stringWithFormat:@"meters: %d", theInteger];
you will get theString = @"meters: 512";
Best Regards
--
Lorenzo
email: email@hidden
_______________________________________________
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.