If I place a typedef enum{kOne,kTwo}whatever; in a .h above the @interface, I know I can use it by method implementations in the .m. That is, I can use kOne and kTwo freely.
Now, I know I can make an @property of whatever thereby exposing the chosen kValue of whatever to other classes, if desired.
But what if I want to expose the enum guts of whatever, so I can access kOne and kTwo from other classes? That is, I want to know how many are included in whatever and access those constants too. For example, I want another class to know that kOne is 0, kTwo is 1, etc.
Is there a way to do this?
Simply
#importthe appropriate header file, just as you need to in order to use the class for which it is defined.You do not need the include guards in @dwerner’s answer because you should not use
#includefor Objective-C headers. Use#importinstead. See this question for more details.