views:

69

answers:

4

Hello.

I've been developing for Visual Studio and C# for a long time. Now, I'm developing with XCode and Objective-C.

On C# I can use /// <summary> to generate documentation. Is there any kind of mechanism like that on XCode to generate documentation? And what kind of comments should I use?

Thank you.

+3  A: 

Have you tried using Doxygen? That claims to support Objective-C. There's even a walkthrough on ADC.

Jon Skeet
What kind of comments should I use?
VansFannel
@VansFannel: Doxygen comments. Read the Doxygen documentation: http://www.stack.nl/~dimitri/doxygen/docblocks.html
Jon Skeet
+1 for Doxygen — it ain't perfect, but it's quite respectable. Since Apple uses HeaderDoc for generating much of their docs, using compatible comment styles is most consistent. I tend to use `/*! ... */` myself.
Quinn Taylor
+1  A: 

There's also AppleDoc to render your Doxygen comments into a style usable by Xcode

RyanWilcox
Ive been using a combination of appledoc and doxygen for a while. Works well for me.
Derek Clarkson
A: 

As a said, my fav pattern :)

   ///////////////////////////////////////////////////////////////////////
   /// \brief setX
   /// \param x offset of the image.
   /// \return a new image as an QImage.
   /////////////////////////////////////////////////////////////////////////
    QImage  setX(int x);
lukas
+1  A: 

You need HeaderDoc which is recommended by Apple for code documentation.

Here's an example.

/*!
 This is a method.

 @param    param1    This is first parameter.

 @result
 This method returns nothing.

 @discussion
 This is an example.


 */
- (void)someMethodWithParam1:(NSInteger)param1
{
}

Manual: http://developer.apple.com/library/mac/#documentation/DeveloperTools/Conceptual/HeaderDoc/intro/intro.html

Eonil