标签:
使用NS_ENUM 和 NS_OPTIONS宏定义枚举。Adopting Modern Objective-C
使用NS_ENUM宏定义一组互斥的枚举值:
typedef NS_ENUM(NSInteger, UITableViewCellStyle) { UITableViewCellStyleDefault, UITableViewCellStyleValue1, UITableViewCellStyleValue2, UITableViewCellStyleSubtitle };//类型名:UITableViewCellStyle
使用NS_OPTIONS定义一个可以组合的值:
typedef NS_OPTIONS(NSUInteger, UIViewAutoresizing) { UIViewAutoresizingNone = 0, UIViewAutoresizingFlexibleLeftMargin = 1 << 0, UIViewAutoresizingFlexibleWidth = 1 << 1, UIViewAutoresizingFlexibleRightMargin = 1 << 2, UIViewAutoresizingFlexibleTopMargin = 1 << 3, UIViewAutoresizingFlexibleHeight = 1 << 4, UIViewAutoresizingFlexibleBottomMargin = 1 << 5 };
枚举宏(Adopting Modern Objective-C)
标签:
原文地址:http://www.cnblogs.com/codelu/p/5559266.html