One Quickie


NSLog without the extra crud (NSString->General)
NSlog puts too much crud in front of the logging line. For a foundation tool that output stuff, it gets in the way. I'd still like for a replacement to expand %@, which the printf() family won't do. Here's a some code that'll do that.
#include <stdarg.h>

void LogIt (NSString *format, ...)
{
    va_list args;

    va_start (args, format);

    NSString *string;

    string = [[NSString alloc] initWithFormat: format  arguments: args];

    va_end (args);

    fprintf (stderr, "%s\n", [string UTF8String]);

    [string release];

} // LogIt



borkware home | products | miniblog | rants | quickies | cocoaheads
Advanced Mac OS X Programming book

webmonster@borkware.com