On Mar 23, 2012, at 9:08 PM, Prime Coderama wrote:

> Trying to write out syslog entries containing strings but they don't register.
> 
> E.g.
> 
> // where person.name is an NSSTring
> syslog(LOG_NOTICE, "Some string %@", person.name);

The %@ format specifier is a Cocoa-ism.  (Well, it's also understood by Core 
Foundation.)  It is not one of the standard printf-style format specifiers.  
You can't expect any random C library routine to understand them and then 
interpret the passed-in argument as an object pointer and invoke -description 
on it.

Try:

syslog(LOG_NOTICE, "Some string %s", [person.name UTF8String]);

Regards,
Ken


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to