Xcode和XIB自我文档 [英] Xcode and XIB self documentation

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

问题描述

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



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



我是新的,所以如果我错过了一些明显的东西,请告诉我。 b
$ b

谢谢。

解决方案

不,没有用于记录.xib文件的工具,除非你考虑文件本身作为您的文档的一部分。 (你确实说过自我记录).xibs存储为XML,但是,如果你真的想提取数据,那么它就有了。



您在IB中创建的操作将显示在源代码中。您可以在此描述发送操作的对象添加注释,但这首先将忽略使用.xib(和操作)的一点,即将UI元素与控制器分离。



如果文档的要点是让您的项目更容易让其他开发人员了解,您可能需要在Objective-C上获得更多经验,然后再创建一个.xib文档工具。给定一个.xib和相关的头文件,任何有能力的Obj-C程序员都应该能够轻易地告诉哪些控件连接到哪个动作,或调试该区域的问题。人们一直在使用.xib和.nib文件20多年 - 缺乏单独的文档工具可能很好地表明这样的事情可能不如起初看起来那么有用。


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?

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.

Thanks.

解决方案

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.

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.

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自我文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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