Xcode中的文档注释是什么? [英] What are documentation comments in Xcode?

查看:180
本文介绍了Xcode中的文档注释是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此问题仅供参考.

在Xcode的设置"窗口的字体和颜色"标签中,是否有文档注释(和关键字)设置?他们是什么?

In the "Fonts & Colors" tab of the Settings window of Xcode, there's a setting for documentation comments (and keywords)? What are they?

推荐答案

随时增强此答案.

文档注释只是(Objective-C)标记为文档的注释.它们与普通注释的处理方式相同,不同之处在于您可以在Xcode中设置其他颜色和字体.某些文档软件甚至可以使用这些注释从给定的头文件和其他源代码自动创建文档.

Documentation comments are just (Objective-C) comments marked as documentation. They are treated the same way as normal comments, except that you can set another color and font in Xcode. Some documentation software may even use these comments to create automatically documentation from given header files and other source code.

文档注释关键字是使文档注释中的关键字后面的文本具有语义含义的关键字.

Documentation comment keywords are keywords that give semantical meaning to text that follows after the keyword in a documentation comment.

您可以用三个斜杠(而不是普通注释中的两个)创建内联文档注释,并阻止文档.两颗星而不是一颗星的评论(而不是正常评论中的一颗星).示例:

You can create inline documentation comments with three slashes (instead of two in normal comments), and block doc. comments with two stars instead of one (instead of one in normal comments). Example:

// Normal inline comment
/// Documentation comment

/* Normal block
comment */
/** Documentation block
comment */

您可以通过在"at"符号后指定一个关键字(仅一个单词)来创建文档注释关键字.示例:

You can create documentation comment keywords by specifying a keyword (one word only) after the "at" symbol. Example:

- (void)sendMessage: (id)sender;
/// @description Sends the receiver.
/// @available Version 1.0 through 2.2

Appledoc 是用于从源代码创建文档集(包括文档注释和方法签名)的工具.并在需要时将其安装并重新加载到Xcode中.这是一个命令行程序,其中包含有关如何将其合并到Xcode构建过程中的说明.

Appledoc is a tool for creating a documentation set from your source code (including documentation comments and method signatures) and getting it to install and reload inside Xcode when needed. It's a command-line program and has instructions for how to incorporate it into your Xcode build process.

拥有文档集后,您可以通过首选项>下载>文档将其添加到Xcode.

Once you have a documentation set you can add it to Xcode via Preferences > Downloads > Documentation.

以@符号开头的特殊关键字也称为HeaderDoc标记.它们的列表可以在 HeaderDoc中找到用户指南.请注意,其中有些是Objective-C,有些是C ++.

The special keywords starting with an @-sign is also called HeaderDoc tags. A list of them can be found in the HeaderDoc User Guide. Please note that some of them are Objective-C and some are C++.

这篇关于Xcode中的文档注释是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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