如何在Xcode中为实例变量和方法创建文档? [英] How to create documentation for instance variable and methods in Xcode?

查看:127
本文介绍了如何在Xcode中为实例变量和方法创建文档?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够将Alt-Click实例变量(或方法)作为我创建的程序的一部分,并读取其用途.

I'd like to be able to Alt-Click an instance variable (or a method) as part of the program i created and read what it's purpose is.

Xcode告诉我class变量声明为-的事实很好,但还不够.在这种情况下,我想查看键入的自定义文本来描述asset的真正含义.另外,了解ivar的类型也很有用.

The fact that Xcode is telling me the class variable is declared at - is nice but not enough. In this case i'd like to see custom text i typed to describe what an asset really is. Additionally type of the ivar would also be useful to know.

这怎么办?在这种情况下,我想知道assets

How can this be done? In this case, i wonder what exactly did i mean by assets

我特别想知道是否可以从Xcode内部查看此信息,类似于Eclipse显示JavaDoc内容的方式.

I specifically wonder if this information can be viewed from inside Xcode, similar to how Eclipse shows JavaDoc content.

推荐答案

您需要为您的项目创建一个文档集并将其安装在Xcode中. appledoc 可以帮助您.这是一个命令行工具,可以从标题中的特殊格式注释生成Apple风格的文档.您还可以通过运行脚本构建阶段将其集成到构建过程中,从而使文档始终是最新的.

You would need to create a documentation set for your project and install it in Xcode. appledoc can help you with this. This is a command-line tool that can generate documentation in Apple's style from specially formatted comments in your headers. You can also integrate this into your build process with a run script build phase, so that documentation is always up-to-date.

对于小型项目,通常通常不值得付出努力,您最好将注释添加到头文件中,然后使用Cmd-click(Ctrl + Cmd + left-arrow返回到原来的位置)跳转到那里来自).

For small projects, it's usually not worth the effort though and you're probably better off just adding comments to your header files and jumping there with Cmd-click (Ctrl+Cmd+left-arrow to go back to where you came from).

这篇关于如何在Xcode中为实例变量和方法创建文档?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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