views:

66

answers:

2

Hi, I have created my iPhone App and i must 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

+1  A: 

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: http://www.stack.nl/~dimitri/doxygen/

pkananen
and for create a document?
zp26
I posted a link for one.
pkananen
ok. Thanks so much
zp26
and the last question, i must add the comments for the .h or for the .h and .m ???
zp26
You can add them however you want. I would recommend looking at some of Apple's example code to see how they document things. A header file is supposed to provide a contract for the class, so much of your documentation will go there.
pkananen
+2  A: 

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

iWasRobbed
and for create a document?
zp26
As an example of this, Core Plot uses Doxygen to generate its framework documentation: http://code.google.com/p/core-plot/wiki/DocumentationPolicy
Brad Larson