Doxygen and Objective-C categories

拈花ヽ惹草 提交于 2019-12-04 01:23:51

After some regression testing (and a little common sense) the solution:

Let's say I have a category Cat1 on NSObject, for doxygen to parse my category header file, it should look roughly like this:

#import <Cocoa/Cocoa.h>

/*! \category NSObject(Cat1) 
    \abstract A category on NSObject
*/

@interface NSObject(Cat1)
    - (void)foo;
@end

and the implementation file:

#import "NSObject_Cat1.h"

@implementation NSObject(Cat1)

- (void)foo {
    //  do something
}

@end

Importantly, place no spaces between the class name and the category name.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!