我有NS_Enum
:
typedef NS_ENUM(NSInteger, Months) {
January,
February,
March,
April,
May
};
...但是枚举应该是公开的。语法对我来说仍然有点混乱,但我想在头文件中声明枚举。以下是有效的声明方式吗?
@interface NSObject (NSDateExtension)
@property (nonatomic,strong) typedef enum Months;
@end
答案 0 :(得分:1)
你的语法错了。它应该是:
@interface NSObject (NSDateExtension)
@property (nonatomic, assign) Months propertyName;
@end