开发者

Why are some constants prefixed with "k" in the Cocoa framework? [duplicate]

This question already has answers here: 开发者_StackOverflow中文版 Closed 12 years ago.

Possible Duplicates:

What does the ‘k’ prefix indicate in Apple’s APIs?

Lower case “k” in Cocoa

Why are some constants prefixed with "k" in the Cocoa framework?


This convention goes all the way back to the early days of Mac programming (1984, Pascal). k is the prefix for a constant and you will also see g as a prefix for globals.


In mathematics and physics, constants are often referred to by using the letter 'k'. This is probably where the convention comes from.

This is not an official code convention supported by Apple.

Duplicate of question 675816.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜