i.e. %@ for strings, %f for doubles... I don't know the word for these placeholders but it would be great to have list for how to print booleans and other values.
It is a normal C format string with the extension of %@ (which prints any NSObject by querying its -description method, not just NSStrings).
You can see an overview in printf manpage
Since NSLog
takes a NSString
as its argument, it uses the NSString
format specifiers. This is virtually identical to the common printf
specifiers. Also, the %@
specifier is not limited to NSString
objects, but is for any Objective-C objects. The base NSObject
class provides a generic description of the object consisting of its class and its address, but many objects will supply information specific to their type, such as the collection classes (NSArray
, NSDictionary
) which will supply nicely formated dump of their contents. You can provide this for your own objects that you create by overriding -description
(see the documentation for more info, including localization capability).
See also: NSString Format Specifiers
Also, there's a very nice overview, as well as some tips and tricks, in the most recent "Friday Q&A" posting on Mike Ash's NSBlog blog:
http://www.mikeash.com/?page=pyblog/friday-qa-2009-07-17-format-strings-tips-and-tricks.html