Xcode:显示我的自定义类的文档 [英] Xcode: show documentation for my custom classes

查看:22
本文介绍了Xcode:显示我的自定义类的文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

How can I force Xcode to show my own documentation for custom classes, methods, etc.? I'm used to Java and Eclipse, which shows me documentation for my classes as shown here:

我怎样才能在 Xcode 中达到同样的效果?是否有 Xcode 可以识别和显示的特殊注释?

How can I achieve the same in Xcode? Are there special comments that Xcode can recognize and display?

推荐答案

从 Xcode 5.0 开始,变量和方法的 Doxygen 和 HeaderDoc 格式会自动解析并呈现在快速帮助弹出窗口中.关于它的更多信息这里,但这里有一些关键点:

As of Xcode 5.0, Doxygen and HeaderDoc formatting for variables and methods is automatically parsed and rendered in the Quick Help popover. More information about it here, but here's some key bits:

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

在 Xcode 中呈现为:

renders in Xcode as:

至于属性,很简单:

/// Base64-encoded data.
@property (nonatomic, strong) NSData *data;

当单击选项时,会出现这个可爱的弹出框:

When option-clicked, this lovely popover appears:

这篇关于Xcode:显示我的自定义类的文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆