Re: "Tricks" of the "Trade"
Re: "Tricks" of the "Trade"
- Subject: Re: "Tricks" of the "Trade"
- From: Greg Titus <email@hidden>
- Date: Thu, 7 Jun 2001 00:43:14 -0700
On Wednesday, June 6, 2001, at 11:55 PM, Max J Cantor wrote:
YES, i do agree with you, NSLog() is a wonderful tool. But, I have a
question, if you want to NSLog() to print the value of an int, is
there a
better way than NSLog([[NSNumber numberWithInt:i] stringValue])?
-Max
The first argument to NSLog() is an NSString which takes all the
printf() style formatting commands, plus %@ for calling -description on
an object. (If you don't know the printf formatting commands, read a
basic C text, or try "man printf" from the terminal.)
So to print the value of an int you would:
NSLog(@"%d", i);
Hope this helps,
--Greg