开发者

Comments for my iPhone App

I have created my iPhone App and i must 开发者_StackOverflow社区do a document like javaDoc in java but i don't find anything with google. I think that the comments have similar syntax but i'm not sure. (/* */)

Can you help me? Thanks


As Peter said above, there is DOxygen and then also DOxyClean which cleans it up a bit. More info here: http://developer.apple.com/tools/creatingdocsetswithdoxygen.html

Comments can either be like this

// this is a comment above some line of code
if (foo != 0) { 
    // do something 
}

or like this

/*
// look ma, i'm commenting out a bunch of code

if (foo != 0) {
   // do something here
}

*/

or like this

// TODO: i'm marking something that will show up as a To-Do item in XCode's drop down list

and i think there's another one but I can't remember off hand


You can use // for single line comments, or /** */ for multi-line comments.

You'd also be wise to make use of #pragma mark to further organize your code. See here: http://cocoasamurai.blogspot.com/2006/09/tip-pragma-mark-organizing-your-source.html

There are also tools like Doxygen: hhttp://www.doxygen.nl


The answer about Doxygen was right on back when it was written, but since then Appledoc has come a long way. It can now generate documentation that actually integrates with the popup dialogs that looks very close to the official documentation.

I would highly advise folks to use Appledoc going forward instead of Doxygen.

http://gentlebytes.com/appledoc/

PS - Doxygen is still a great product, and can be used for other things. It's just not the best for iOS projects anymore.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜