【发布时间】:2014-05-30 21:21:49
【问题描述】:
我正在使用 Doxygen 来记录用 Objective-C 编写的 API。
Doyxygen 无法理解 NS_ENUM typedef。
我找到了这个解决方案,但它对我不起作用。
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
PREDEFINED = NS_ENUM(x,y)=y
Regards,
Dimitri
这是我的输入文件:
/**
* Represent the possible states.
*/
typedef NS_ENUM(NSInteger, ABEnumType)
{
/**
* State A.
*/
StateA = 0,
/**
* State B.
*/
StateB
};
这是我得到的输出:
Preprocessing /src/ABEnumType.h...
error: /src/ABEnumType.h:17:17: error: C++ requires a type specifier for all declarations [clang]
error: /src/ABEnumType.h:17:28: error: unknown type name 'ABEnumType' [clang]
error: /src/ABEnumType.h:18:1: error: function definition is not allowed here [clang]
error: /src/ABEnumType.h:17:9: error: C++ requires a type specifier for all declarations [clang]
Parsing file /src/ABEnumType.h...
【问题讨论】:
-
只是想知道,你试过在
StateB后面加逗号吗?据我所知,这是我所做的工作与您的示例之间的唯一区别。 -
@IdoRan 差不多了。您需要添加 NS_ENUM(x,y)=enum y
标签: objective-c doxygen nsenumerator