• 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: print object by %@
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: print object by %@


  • Subject: Re: print object by %@
  • From: "Stephen J. Butler" <email@hidden>
  • Date: Thu, 22 Jul 2010 13:06:31 -0500

On Thu, Jul 22, 2010 at 12:57 PM, Ariel Feinerman <email@hidden> wrote:
> Thank you for yours, but I am looking for more convenient way, I mean a
> function for console output, not for debugging like NSLog(),
>
> so I wish:
>
> NSLog(@"object is %@", obj);
> // $ object is [object description]
>
> I would not wish to convert NSString to utf8 for printf(), I wish to use
> NSString

If you REALLY want to avoid C stdio...

I think the closest you'll get is [NSFileHandle
fileHandleWithStandardOutput]. But even then, NSFileHandle writes
NSData objects, not NSStrings. So you'll still need something like
[myString dataUsingEncoding:NSUTF8StringEncoding]. Which is really
what you want anyway since most people's terminals are setup to accept
UTF-8.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: print object by %@
      • From: Ariel Feinerman <email@hidden>
References: 
 >print object by %@ (From: Ariel Feinerman <email@hidden>)
 >Re: print object by %@ (From: Jean-Daniel Dupas <email@hidden>)
 >Re: print object by %@ (From: Ariel Feinerman <email@hidden>)

  • Prev by Date: Deselect keyboard focus of an NSMatrix cell
  • Next by Date: Re: Array controllers in code?
  • Previous by thread: Re: print object by %@
  • Next by thread: Re: print object by %@
  • Index(es):
    • Date
    • Thread