2012-03-09 25 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

相關問題