What's the naming convention for constants in Objective-C (or most widely used way to name them)?
Is there a different criteria for extern
constants?
Some styles I have seen:
NSString* const kPreferenceFirstRun = @"FirstRun";
// Replace "XY" by a prefix representing your company, project or module
NSString* const XYPreferenceFirstRun = @"FirstRun";
After a bit of googling I've found the official coding guidelines for Cocoa.
To sum up:
extern
constantsI agree with itaiferber that the k prefix style is clearer and also much more useful for autocompletion. It would be interesting to know if this style is more popular than the official guidelines.