I read Shaggy Frog’s answer to this post and was intrigued by the following line of code:
NSLog(@"%@", [NSString stringWithFormat:@"%@:%*s%5.2f", key, padding, " ", [object floatValue]]);
I know that formatting strings is an old art, but I’m kind of ending up in Cocoa / Obj-C programming and skipped a few classes along the way. Where is a good (best) place to learn all the string formatting tricks allowed in an NSString stringWithFormat ? I am familiar with Apple String Format Specifiers , but from what I can say, it does not shed light on everything that happens with %*s or %5.2f (not to mention 3 obvious placeholders followed by 4 arguments) above? !?
source share