• 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: Write text to the stdout
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Write text to the stdout


  • Subject: Re: Write text to the stdout
  • From: Finlay Dobbie <email@hidden>
  • Date: Fri, 3 Jan 2003 14:21:26 +0000

On Friday, January 3, 2003, at 01:57 pm, Arthur VIGAN wrote:

I am programming a Foundation Tool for use with the terminal app, but I have troubles to ouput text in the terminal (the stdout in this case). The problem comes with the NSString. I can't use the printf() function with NSString, so what should I use?

If you just want it for debug purposes, you can use NSLog, which prints to stderr. Or you could get a c string from your NSString, see the NSString documentation, and printf() that. Or, you could get an NSData from your NSString, again see the NSString documentation, then write that to an NSFileHandle to stdout, see the NSFileHandle documentation.

-- Finlay
_______________________________________________
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.

References: 
 >Write text to the stdout (From: Arthur VIGAN <email@hidden>)

  • Prev by Date: Turning modal call into non-modal operation?
  • Next by Date: Re: Write text to the stdout
  • Previous by thread: Re: Write text to the stdout
  • Next by thread: Re: Write text to the stdout
  • Index(es):
    • Date
    • Thread