Created
May 19, 2011 15:08
-
-
Save madebyjeffrey/980971 to your computer and use it in GitHub Desktop.
Printf FileHandle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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