Firstly, I saw this question and understand why the following code does not work. This is not my question.
I have a constant that is declared as:
//Constants.h extern NSString * const MyConstant; //Constants.m NSString * const MyConstant = @"MyConstant";
However, in some contexts it is more useful to have this constant with a much more descriptive name, for example MyReallySpecificConstant . I was hoping to do:
//SpecificConstants.h extern NSString * const MyReallySpecificConstant; //SpecificConstants.m
Obviously, I cannot do this (which is explained in the related question above).
My question is:
How else (besides something like #define MyReallySpecificConstant MyConstant ) can I provide one constant under several names?
c objective-c constants
Dave delong
source share