Doxygen在objective-c中检测不到NS_枚举

Doxygen在objective-c中检测不到NS_枚举,objective-c,doxygen,nsenumerator,Objective C,Doxygen,Nsenumerator,我正在使用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 这是我的输入文件: /**

我正在使用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...

如果Doxygen失败,您可以随时尝试

编辑:我用一个测试类尝试了headerdocs,我认为它确实提供了对NS_ENUM的良好支持

//
//  VLTTestClass.h
//  VPNLoginTest
//

#import <Foundation/Foundation.h>

/*!
 Test class type description.
 */
typedef NS_ENUM(NSInteger, VLTestClassType) {
    /*!
     Description for type 1.
     */
    VLTestClassType1,
    /*!
     Description for type 2.
     */
    VLTestClassType2
};

/*!
 Description for test class
 */
@interface VLTTestClass : NSObject

@end
//
//vlttclass.h
//VPNLoginTest
//
#进口
/*!
测试类类型描述。
*/
typedef NS_ENUM(NSInteger,VLTestClassType){
/*!
类型1的说明。
*/
VLTestClassType1,
/*!
类型2的说明。
*/
VLTestClassType2
};
/*!
测试类的描述
*/
@接口VLTTestClass:NSObject
@结束

以下是headerdoc2html:

以下设置对我们有效:

 ENABLE_PREPROCESSING   = YES 
 MACRO_EXPANSION        = YES 
 EXPAND_ONLY_PREDEF     = YES 
 PREDEFINED             = NS_ENUM(x,y)=enum y 
有了这些,我们可以看到所有NS_ENUM结构都显示在我们的doxygen生成的文档中

答案有帮助,但我们还需要启用
提取所有
。因此,以下设置适用于我们:

 EXTRACT_ALL            = YES
 ENABLE_PREPROCESSING   = YES 
 MACRO_EXPANSION        = YES 
 EXPAND_ONLY_PREDEF     = YES 
 PREDEFINED             = NS_ENUM(x,y)=enum y

有趣的是,校长们在NS_ENUM的工作也很差劲。这就是为什么我选择了Doxygen:)@IdoRan另一个选项是。也是一个有用的Xcode插件:嗨,谢谢。我都找到了。AppleDoc也不支持NS_ENUM:)请尝试。我已经安装了VVDocumenter,它工作得很好。只是想知道,您是否尝试过在
StateB
后面加逗号?“据我所知,这是我的工作和你的例子之间的唯一区别。”我几乎做到了。您需要添加NS_ENUM(x,y)=ENUM yI必须对此使用一个细微的变化:
prefined=“NS_ENUM(type,name)=ENUM name”
。我的声明的格式是:
typedef NS\u ENUM(NSInteger,NameOfEnum)
更准确地说,它应该是
PREDEFINED=“NS\u ENUM(\u type,\u name)=ENUM\u name:\u type”