I’ve been working in Objective-C a lot more often recently, and one of the things that I most often find myself needing to lookup are the format specifiers for NSStrings (usually when I need to output something to the console for debugging purposes using NSLog). Apple’s documentation is alright, but there’s a lot of junk I’ll never need there, and it isn’t organized in a particularly useful fashion for quick reference.
So I took a little time and whipped up a cheat sheet with the basic format specifiers that I am most likely to need. This is by no means a complete list, and there are lots of synonyms, advanced modifiers, and other tidbits the cheat sheet ignores, but it covers the vast majority of my logging needs when it comes to outputting variable values so hopefully it will be useful to others, as well.
The cheat sheet is available both on the web and as a PDF download.
Posted 5:11 PM on Jan. 18, 2011 ↑