Objective C - Why do constants start with k

后端 未结 6 895
栀梦
栀梦 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条回答
  •  伪装坚强ぢ
    2020-12-05 04:37

    Current recommendations from Apple for naming constants don't include the 'k' prefix, but many organizations adopted that convention and still use it, so you still see it quite a lot.

提交回复
热议问题