In the latest tools, a new kind of enum
s are now allowed:
typedef enum CarType : NSUInteger {
FourDoorCarType,
TwoDoorCarType
} CarType;
My question comes in parts:
Why should I use this instead of the old way?
Why does
CarType
appear twice? I tried skipping the firstCarType
and just leaving the first line as "typedef enum : NSUInteger {
", and it seems to work fine. What are the drawbacks, if any?Can some types other than
NSUInteger
be used?