2012-03-09 52 views
0

在iOS/OSX的Xcode中。如何将javadoc自动添加到我的方法中?

我想从API文档中提取文本,以便在每种方法上方自动填充我的javadoc注释。例如,如果我写

- (id)initWithFrame:(CGRect)frame { 
} 

我想运行一个脚本来获取此

/** 
* Initializes and returns a newly allocated view object with the specified frame rectangle. 
* 
* @param frame: The frame rectangle for the view, measured in points. 
* @return An initialized view object or nil if the object couldn't be created. 
*/ 
- (id)initWithFrame:(CGRect)frame { 
} 

此数据(描述,参数和返回)获得,当你ALT +单击的方法和泡沫出现与文件有关。

是否可以通过脚本访问文档以提取文本并组成Javadoc?那个脚本已经写好了吗?欢迎任何资源,教程或手册开始学习Xcode脚本。

回答

0

我发现的唯一的解决办法是使用应用程序,如短跑,来管理代码片段。有了它,我可以粘贴方法的签名和文档。问题是,这不是自动的,因为我想,但它可以工作。

0

当然,使用Doxygen

+0

Doxygen从源代码创建文档。我想从文档中添加“源代码”,反过程。 – emenegro 2012-03-09 08:41:14

+0

对不起,我没有正确回答你的问题。我是对的,你想为所有重写的方法添加javadoc? – OgreSwamp 2012-03-09 10:02:04

相关问题