Skip to content

Instantly share code, notes, and snippets.

@madebyjeffrey
Created May 19, 2011 15:08
Show Gist options
  • Save madebyjeffrey/980971 to your computer and use it in GitHub Desktop.
Save madebyjeffrey/980971 to your computer and use it in GitHub Desktop.
Printf FileHandle
@implementation NSFileHandle (print)
- (void) printf: (NSString*) format, ...
{
NSString *output;
va_list ap;
va_start(ap, format);
output = [[NSString alloc] initWithFormat: format arguments: ap];
[self writeData: [output dataUsingEncoding: NSUnicodeStringEncoding]];
va_end(ap);
[output release];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment