Xcode 和 XIB 自我文档

Xcode and XIB self documentation(Xcode 和 XIB 自我文档)

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

问题描述

是否有记录许多 Xcode 绑定、outlet 和 IBAction 绑定、键值绑定等的工具?我看过 Doxygen 和 HeaderDoc,但是这些文档程序文件,用来描述类等,但似乎没有涵盖 Xcode 拖放启用的大量隐藏"链接?

Is there a tool for documenting the many Xcode bindings, outlet and IBAction bindings, key value bindings, etc? I have looked at the threads on Doxygen and HeaderDoc, but these document program files, to describe classes etc, but don't seem to cover the huge number of 'hidden' linkages that Xcode drag-and-drop enables?

一个具体的例子,我可以使用 XIB 编辑器为我窗口上的每个控件创建一个 IBAction,创建一个或多个类/实例中的方法,定义在一个或多个文件中 - 我想要所有这些的一个列表,显示控件类型和名称、源文件、类和方法 - 或者图形表示会更好.然后一个类似的键值路径列表链接到 arrayControllers 等.

A specific example, I can use the XIB editor to create an IBAction for every control on my window, to methods in one or more class/instances, defined in one or more files - I want ONE list of all of these, showing the control type and name, the source file, class and method - or a graphical representation would be even better. Then a similar list for the key value path links to arrayControllers etc.

我是新手,所以如果我遗漏了一些明显的东西,请告诉我.

I AM new, so if I have missed something obvious, please tell me.

谢谢.

推荐答案

不,没有用于记录 .xib 文件的工具,除非您将文件本身视为文档的一部分.(毕竟你确实说过自我记录".).xibs 存储为 XML,所以如果你真的想提取数据,它就在那里.

No, there's no tool for documenting .xib files unless you consider the file itself as part of your documentation. (You did say "self documenting" after all.) .xibs are stored as XML, though, so if you really want to extract the data, it's there to be had.

您在 IB 中创建的操作会出现在您的源代码中.您可以在此处添加注释来描述发送操作的对象,但这会在很大程度上忽略首先使用 .xib(和操作)的意义,即将 UI 元素与控制器分离.

The actions you create in IB appear in your source code. You could add comments there describing the object that sends the action, but that would largely miss the point of using a .xib (and actions) in the first place, which is to decouple the UI elements from the controller.

如果文档的目的是让其他开发人员更容易理解您的项目,那么您可能希望在创建 .xib 文档工具遇到很多麻烦之前获得更多有关 Objective-C 的经验.给定一个 .xib 和相关的头文件,任何称职的 Obj-C 程序员都应该能够轻松分辨哪些控件与哪些操作相关联,或者调试该区域中的问题.人们使用 .xib 和 .nib 文件已有 20 多年了——缺乏单独的文档工具可能是一个很好的迹象,表明这样的东西可能不像最初看起来那么有用.

If the point of the documentation is to make your project easier for other developers to understand, you might want to get some more experience with Objective-C before you go to a lot of trouble creating a .xib documenting tool. Given a .xib and the relevant header files, any competent Obj-C programmer should be able to tell easily which controls are connected to which actions, or to debug problems in that area. People have been working with .xib and .nib files for 20+ years -- the lack of a separate documentation tool may be a good indication that such a thing may not be as useful as it seems at first.

这篇关于Xcode 和 XIB 自我文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:Xcode 和 XIB 自我文档

基础教程推荐