What does the 'k' prefix indicate in Apple

2019-01-14 05:50发布

问题:

This question already has an answer here:

  • Lower case “k” in Cocoa 2 answers

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

回答1:

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



回答2:

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