index, AV, AppleScript, Bicycle, Cinema, DTM, Dairy, Dev, Fashion, Fitness, Game, Health, Help, Lyrics, Meal, Motor, Motorcycle, Music, Objective-C, PC, PDA, Phone, Robot, S15S, Stationary, Swift, Text, Travel, V36, Watch
extern void _NSSetLogCStringFunction(void(*)(const char*, unsigned, BOOL)); static void _SRLogCString( const char* message, unsigned length, BOOL withSysLogBanner) { NSAutoreleasePool* pool; pool = [[NSAutoreleasePool alloc] init]; // Append debug string NSString* string; string = [NSString stringWithCString:message length:length]; [[SRDebugWindowController sharedInstance] appendDebugString:string]; [[SRDebugWindowController sharedInstance] appendDebugString:@"\n"]; [pool release]; } - (void)awakeFromNib { // Register customized log function setbuf(stderr, NULL); _NSSetLogCStringFunction(_SRLogCString); }_NSSetLogCStringFunction() で関数を設定してやると、NSLog() がその関数を呼び出すらしい。