Re: print object by %@
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