I have a situation where I’m declaring multiple related typedef enums in my constants file:
typedef enum
{
AnimalTypeBear,
AnimalTypeBunny,
MemeTypeCount
}
AnimalType;
typedef enum
{
FishTypeSalmon,
FishTypeTrout,
FishTypeCount
}
FishType;
Now I’d like to define a parameter for an initializer called type that can take in both of these typedef enums as a parameter. I’m currently defining type as an NSUInteger and I keep getting 0 no matter which type I send into the initializer (ie FishTypeTrout should be 1 but it is 0). What type of object should type be to work for both enter code heretypeDef enums?
I’m not 100% certain what you’re asking, but I tried the following code:
and it prints 1 when I call
TestFunction(FishTypeTrout);Does that help?