What are these called in Objective C? @"%@"
@"%d"
@"%i"
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
They are called format specifiers, could also be called 'placeholders in a string for the variables that will follow'.
https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Strings/Articles/formatSpecifiers.html
回答2:
They are NSString literal
s. More specifically, they look they are being used as formatting strings for printf
style functions.
回答3:
I believe that they are called 'format placeholders', as suggested by this wikipedia article: http://en.wikipedia.org/wiki/Printf_format_string#Format_placeholders