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

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

发布于 2013-10-09 04:54:05
从Xcode5.0开始,变量和方法的Xcode和HeaderDoc格式将自动解析并呈现在快速帮助弹出窗口中。更多关于它的信息,here,但这里有一些关键点:
/**
* 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中呈现为:

至于属性,就像下面这样简单:
/// Base64-encoded data.
@property (nonatomic, strong) NSData *data;按住Option键并单击时,将显示此可爱的弹出窗口:

发布于 2013-11-25 17:34:00
嗯,看起来这些课程的问题还没有得到回答,所以我会把我的建议贴出来。
就在MyClass.h文件中的@interface MyClass : NSObject行之前,您可以像在示例中一样使用注释,但需要添加一些标记来显示文本。例如,下面的代码:
/**
* @class GenericCell
* @author Average Joe
* @date 25/11/13
*
* @version 1.0
*
* @discussion This class is used for the generic lists
*/将产生以下输出:the output of the code above http://imageshack.com/a/img18/2194/kdi0.png
发布于 2011-11-12 09:09:50
https://stackoverflow.com/questions/6958413
复制相似问题