• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: "Tricks" of the "Trade"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: "Tricks" of the "Trade"
  • Next by Date: Re: "Tricks" of the "Trade"
  • Previous by thread: Re: "Tricks" of the "Trade"
  • Next by thread: Re: "Tricks" of the "Trade"
  • Index(es):
    • Date
    • Thread