如何强制Xcode显示我自己的自定义类,方法等文档?我已经习惯了Java和Eclipse,它向我展示了我的类的文档,如下所示:

如何在Xcode中实现相同的目标?是否有Xcode可以识别和显示的特殊注释?

cbo*_*wns 46
从Xcode 5.0开始,变量和方法的Doxygen和HeaderDoc格式在"快速帮助"弹出窗口中自动解析和呈现.关于它的更多信息,在这里,但这里的一些关键位:
/**
* Add a data point to the data source.
* (Removes the oldest data point if the data source contains kMaxDataPoints objects.)
*
* @param aDataPoint An instance of ABCDataPoint.
* @return The oldest data point, if any.
*/
- (ABCDataPoint *)addDataToDataSource:(ABCDataPoint *)aDataPoint;
Run Code Online (Sandbox Code Playgroud)
在Xcode中呈现为:

至于属性,它就像:
/// Base64-encoded data.
@property (nonatomic, strong) NSData *data;
Run Code Online (Sandbox Code Playgroud)
当选项单击时,会出现这个可爱的弹出框:

Deb*_*h88 12
好吧,似乎对于课程这个问题还没有得到解答,所以我会发表我的建议.
就在@interface MyClass : NSObjectMyClass.h文件中的行之前,您可以像在示例中一样使用注释,但添加一些标记来显示文本.例如下面的代码:
/**
* @class GenericCell
* @author Average Joe
* @date 25/11/13
*
* @version 1.0
*
* @discussion This class is used for the generic lists
*/
Run Code Online (Sandbox Code Playgroud)
将产生以下输出: 上面代码的输出http://imageshack.com/a/img18/2194/kdi0.png
也可以在文档中添加一些代码片段,如下所示

通过添加以下代码
* @code
* - (UIButton*) createButtonWithRect:(CGRect)rect
{
// Write your code here
}
* @endcode
Run Code Online (Sandbox Code Playgroud)
有关记录自定义类方法的更多详细信息,请查看我的博客Xcode中的函数文档.
要让Xcode显示类的文档,您必须使用Doxygen或HeaderDoc等工具为类创建文档集.创建文档集后,必须使用Xcode的文档首选项安装它.Apple有一篇关于使用Doxygen的文章,但它涵盖了Xcode 3,而不是4.