If you use this
int i = 1; NSString *name = @"thefirstsong"; NSString *filename = [NSString stringWithFormat:@"%0d-%@.mp3", i, name];
filename will contain 01-thefirstsong.mp3 .
%@ is a placeholder for integer integer strings (NSString).
source share