Im using the spiffy new NS_ENUM to try and define an enum in my objective-c iOS project.
I'm declaring the NS_ENUM in the header of a class like so:
NS_ENUM(int, SomeEnumType){
SomeEnumType1,
SomeEnumType2,
SomeEnumType3,
SomeEnumType4
};
@interface Issue : NSObject
....
And im getting the compiler warning:
ISO C forbids forward references to 'enum' types
Now if i define the enum the (slightly) older traditional way like so:
typedef enum{
SomeEnumType1,
SomeEnumType2,
SomeEnumType3,
SomeEnumType4
}SomeEnumType;
@interface Issue : NSObject
....
in exactly the same place in the code the issue goes away. What am i doing wrong with NS_ENUM?
EDIT:
I corrected it by adding the typedef but its still giving a warning.
I have turned on the pedantic compiler warnings. Is this just a case where its being too pedantic or is there a correct way that im missing?