Why are some constants prefixed with "k" in the Cocoa framework? [duplicate]
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.
精彩评论