如果我們從Apple API鍵入方法,Xcode將在自動完成彈出列表下方顯示方法功能。但是輸入一個用戶定義的方法,它什麼也沒有顯示。如何讓Xcode在用戶定義的方法下顯示註釋?
有沒有辦法告訴Xcode顯示我自己定義的一些描述,以顯示如何使用用戶定義的方法?
謝謝!!!
@HAS:
我按照你的指令,直到第12步,而在.h文件中創建一個簡單的測試類爲:
#import <Foundation/Foundation.h>
@interface AMCAppleDocTest : NSObject
@property (nonatomic, retain) NSString *version;
+ (id) test;
/** @name Section title */
/** Method description */
- (void)doSomething;
@end
然後到第13步,我運行腳本,但發生錯誤的圖片下面:
http://oi43.tinypic.com/686lqd.jpg
我.SH腳本:
#! /bin/sh
docsURL="http://www.AMC.com";
projectsPath="$2/../";
docsPath="/Users/AMC/Library/Developer/Documentations/$1";
# create AppleDocOutput folder if not exists
if [ ! -d $docsPath ];
then
mkdir "${docsPath}";
fi
/Users/AMC/Library/Developer/DocumentationStuff/appledoc \
--project-name "$1" \
--project-company "AMC" \
--company-id "com.AMC" \
--docset-atom-filename "$1.atom" \
--docset-feed-url "${docsURL}/%DOCSETATOMFILENAME" \
--output "/Users/AMC/Library/Developer/Documentations/$1" \
--docset-package-url "${docsURL}/%DOCSETPACKAGEFILENAME" \
--docset-fallback-url "${docsURL}/$1Doc/" \
--publish-docset \
--logformat xcode \
--keep-undocumented-objects \
--keep-undocumented-members \
--keep-intermediate-files \
--no-repeat-first-par \
--no-warn-invalid-crossref \
--ignore "*.m" \
--ignore "LoadableCategory.h" \
--index-desc "$2/readme.markdown" \
"$2" > "${docsPath}/AppleDoc.log"
而且.command文件:
#!/usr/bin/osascript
tell application "Xcode"
tell first project
-- variables to export
set projectName to (get name)
set projectDir to (get project directory)
set company to (get organization name)
-- invoke script passing extracted variables
do shell script ("sh /Users/AMC/Library/Developer/DocumentationStuff/appledoc.generate.sh " & projectName & " " & projectDir & " " & company)
end tell
end tell
再說,我的版本的Xcode 4.5.1是和OS X 10.8。
Xcode未安裝到/ Applications文件夾中,而是放在桌面上。有關係嗎?
@再次具有
我發現了什麼問題:劇本是在DOS格式。我在VI中使用解決了這個問題:set ff = unix。現在每天的事情去perfectlly:
http://oi43.tinypic.com/2uj58yb.jpg
可能是這個鏈接將幫助你:) [1]:http://stackoverflow.com/questions/10530695/show-method-definition-description-in-xcode-4 – Mahesh 2013-04-25 06:37:20
對不起,長時間的延遲但我剛剛看到您的編輯,除非您發表評論,否則我不會收到任何消息...您確定已將腳本設置爲可執行文件(步驟6)嗎? – HAS 2013-04-27 20:04:16
如果你這樣做嘗試在'磁盤工具'修復權限 – HAS 2013-04-27 20:22:54