An easy way for value type constants, such as integers, is to use enum hack as scheduled by unbeli.
One of the advantages of using extern is that it was all allowed at compile time, so no memory is needed to store the variables.
Another method is to use static const , which was supposed to replace enum hack in C / C ++.
// File.h static const int SKFoo = 1; static const int SKBar = 42;
A quick scan through Apple headers reveals that an enumeration method is the preferred way to do this in Objective-C, and I actually find it cleaner and use it myself.
In addition, if you create parameter groups, you must use NS_ENUM to create type constants.
Further information on NS_ENUM and cousin NS_OPTIONS is available at NSHipster .
Gerry shaw
source share