How can I have a two-digit integer in a a string, even if the integer is less than 10?
[NSString stringWithFormat:@"%d", 1] //should be @"01"
I believe that the stringWithFormat specifiers are the standard IEEE printf specifiers. Have you tried
[NSString stringWithFormat:@"%02d", 1];
2.1m questions
2.1m answers
60 comments
57.0k users