Name for %@ %d in an NSString

2020-02-06 09:00发布

What are these called in Objective C? @"%@" @"%d" @"%i"

3条回答
小情绪 Triste *
2楼-- · 2020-02-06 09:27

I believe that they are called 'format placeholders', as suggested by this wikipedia article: http://en.wikipedia.org/wiki/Printf_format_string#Format_placeholders

查看更多
爷的心禁止访问
3楼-- · 2020-02-06 09:40

They are NSString literals. More specifically, they look they are being used as formatting strings for printf style functions.

查看更多
别忘想泡老子
4楼-- · 2020-02-06 09:43

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

查看更多
登录 后发表回答