问题:Objective-C(iOS)中的typedef枚举如何包含文档注释块?
背景信息:我正在构建一个.Framework,需要确保我的Parser在内部得到充分记录,以便第三方开发人员享受更好的体验。 :)
代码:
/*!
@typedef SCElementTypes
@brief Types of Element SCParser may find and attempt to define
@constant kCharacters Not a Tag.
@constant kOpenTag Tag Opens
@constant kCloseTag Tag Closes
@constant kSingleTag Tag Is Single
*/
typedef enum SCElementTypes : NSUInteger {
kCharacters = (1 << 0),
kOpenTag = (1 << 1),
kCloseTag = (1 << 2),
kSingleTag = (1 << 3)
} SCElementTypes;
注意:我知道如何使文档注释块适用于typedef(在许多方面),但不是typedef枚举......
答案 0 :(得分:1)
像这样:
typedef enum SCElementTypes : NSUInteger
{
/**Character description*/
kCharacters = (1 << 0),
/**OpenTag description*/
kOpenTag = (1 << 1),
/**...*/
kCloseTag = (1 << 2),
kSingleTag = (1 << 3)
} SCElementTypes;