在最新的工具,一种新的enum
s的现在允许:在Objective-C新枚举
typedef enum CarType : NSUInteger {
FourDoorCarType,
TwoDoorCarType
} CarType;
我的问题来自于部分:
我为什么要使用这个而不是旧的方式?
为什么
CarType
会出现两次?我尝试跳过第一个CarType
,只是把第一行作为“typedef enum : NSUInteger {
”,它似乎工作正常。有什么缺点?可以使用
NSUInteger
以外的其他类型吗?
+1张贴提高认识问题的答案。我没有听说过这个功能。 – 2012-07-20 09:12:56