Created
January 5, 2017 01:46
-
-
Save edwardean/e2dfd515280dfb49891f2f1c0b678cdf to your computer and use it in GitHub Desktop.
Fast int to NSString conversion
This file contains hidden or 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
int i = 123; | |
char *buffer; | |
asprintf(&buffer, "%d", i); | |
NSString *s = [NSString stringWithUTF8String:buffer]; | |
free(buffer); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment