Objective C - Why do constants start with k

后端 未结 6 891
栀梦
栀梦 2020-12-05 04:10

Why do constants in all examples I\'ve seen always start with k? And should I #define constants in header or .m file?

I\'m new to Objective C, and I don\'t know C. I

6条回答
  •  -上瘾入骨i
    2020-12-05 04:30

    I believe it is because of the former prevalence of Hungarian Notation, so k was chosen because c stood for character. ( http://en.wikipedia.org/wiki/Hungarian_notation )

    --Alan

提交回复
热议问题