So this is the code:
typedef enum{ zero, one, two, three, four, five, six, seven, eight, nine }Digits; typedef enum{ zero, one, two, nine }DigitsThatILikeToUse;
Question: If I define a function:
void takeMyFavoriteDigits(DigitsThatILikeToUse favorite); (C) -|+(void) takeMyFavoriteDigits:(DigitsThatILikeToUse)favorite; (Objective-C)
I cannot use it with backreference for the base enum Digits , because my order in the enum DigitsThatILikeToUse is different.
My solution is to write the explicit position of the numbers as follows:
typedef enum{ zero = 0, one = 1, two = 2, nine = 9 }DigitsThatILikeToUseInEdition;
But! I cannot repeat this new enum DigitsThatILikeToUseInEdition .
I want to create a subEnum in enum and repeat it. is it possible?
My best idea is to use something like this:
typedef enum{ beginIteratorDigitsThatILike, zero, one, two, nine, endIteratorDigitsThatILike, three, four, five, six, seven, eight }Digits;
But maybe some solutions?