Created
January 8, 2012 14:19
-
-
Save jamztang/1578509 to your computer and use it in GitHub Desktop.
NSStringf. Simpler printf styled +[NSString stringWithFormat:]
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
// | |
// JTStringAddition.h | |
// | |
// Created by James Tang on 27/08/2011. | |
// | |
NSString *NSStringf(NSString *format, ...); |
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
// | |
// JTStringAddition.m | |
// | |
// Created by James Tang on 27/08/2011. | |
// | |
#import "JTStringAddition.h" | |
NSString *NSStringf(NSString *format, ...) { | |
va_list ap; | |
NSString *str; | |
va_start(ap,format); | |
str=[[NSString alloc] initWithFormat:format arguments:ap]; | |
va_end(ap); | |
return [str autorelease]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment