I know that constants start with a prefix k, but does someone have their own constant prefix, so they can easily get terminated on their constants, and not on Apple?
I use a three-letter prefix for my classes because of the name of my company, let it pretend OMG. I tried the prefix of my constants omgkConstantName, but this is not very nice. I also played with kkor ok(o from OMG.) Or maybe I should do kOMGConstantName, which looks more Cocoa -ish?
It seems very useful to quickly get to your own constants, just as you might want to get to your own classes. Does anyone do this? Is this a terrible Cocoa style?
Also, is there a good naming convention for static variables that you would use in only one class, like keys for a JSON dictionary? Should they have k? Should they start with capital letters or follow normal cases?
static NSString *searchTextKey = @"searchText";
static NSString *searchResultsKey = @"searchResults";
(more)
zekel source
share