Objective-C: Generating Documentation

I have been developing in Visual Studio and C # for a long time. I am now developing with Xcode and Objective-C.

In C #, I can use /// <summary>

to generate documentation. Is there any mechanism in Xcode for generating documentation? And what comments should I use?

Thanks.

+2


a source to share


5 answers


Have you tried using Doxygen ? It claims to support Objective-C. There's even a pass to the ADC.



+4


a source


There's also AppleDoc to make your Doxygen comments in the style used by Xcode



+1


a source


You need HeaderDoc 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
{
}

      

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

+1


a source


As Jon Skeet said the most popular method is Doxygen, and from what I can tell so far, comment formatting is mostly AppleDoc compatible.

Also don't forget to check out the comment generator plugin that Fred McCann wrote: http://www.duckrowing.com/2011/05/14/using-the-doxygen-helper-in-xcode-4/

He also has a great practice post for writing Doxygen comments: http://www.duckrowing.com/2010/03/18/documenting-objective-c-with-doxygen-part-i/

(It would be better as a comment on John, but alas, I have no points.)

+1


a source


As said, my fav template :)

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

      

0


a source







All Articles