What does the 'k' prefix indicate in Apple

2019-01-14 04:57发布

This question already has an answer here:

I've run across many examples of Core Foundation variables named k + someVariableNameHere or k + APILibraryName(2Char) + someVariableNameHere. What does this prefix K indicate?

Examples include:

kGLPFAStereo
kCollectionLockBit
kSetDebugOption

2条回答
混吃等死
2楼-- · 2019-01-14 05:38

This is a naming convention from the early days of macintosh programming. It indicates a constant.

查看更多
冷血范
3楼-- · 2019-01-14 05:39

The k means constant in hungarian notation... see Lower case "k" in Cocoa.

查看更多
登录 后发表回答