objective-c - Typedef 枚举的内联文档注释 block

标签 objective-c enums documentation comments typedef

问题:Objective-C (iOS) 中的 typedef 枚举如何包含文档注释 block ?

上下文:我正在构建一个.Framework,需要确保我的解析器在内部有完整的文档记录,以便第三方开发人员享受更多更好的服务。 :)

代码:

/*!
 @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;

注意:我知道如何使文档注释 block 适用于 typedef(以及很多东西),但不知道 typedef 枚举...

最佳答案

像这样:

typedef enum SCElementTypes : NSUInteger
{
    /**Character description*/
    kCharacters = (1 << 0),

    /**OpenTag description*/
    kOpenTag = (1 << 1),

    /**...*/
    kCloseTag = (1 << 2),
    kSingleTag = (1 << 3)
} SCElementTypes;

关于objective-c - Typedef 枚举的内联文档注释 block ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21639887/

相关文章:

java - 为什么我收到错误 "variable ' 颜色可能尚未初始化? java

c - 如何在 C/C++ 中获取枚举值的索引

c# - 在 C# 中,如何轻松地将枚举标志从一种类型映射到另一种类型?

ios - CALayer 层未自动释放

ios - 如何从单元测试类访问静态变量?

LISP 打印函数文档字符串

documentation - KDoc:插入代码片段

documentation - Doxygen:分组模块和页面?

ios - ARC dealloc 的 Hook 结束

ios - 在不同 View Controller 中显示表格 View 单元格的标题