Could anyone share the the ways to do the documentation in objective C? Is there any standard way like it is in java?
-
possible duplicate of [Documentation-generator for Objective-C?](http://stackoverflow.com/questions/813529/documentation-generator-for-objective-c) – Jacob Relkin Jul 30 '10 at 19:10
-
well.. actually I am looking for some tutorials for writing documentations in objective C. – Winston Chen Jul 30 '10 at 19:28
4 Answers
Good news for all! :D Finally after waiting a long time Apple has introduced a parser comments for our projects. According to the new features in XCode 5:
Project documentation from framework API reference documentation and structured comments in your own source code are displayed in the quick help panel and in code completion popover views. Doxygen and HeaderDoc structured comments are supported formats.
and from the Clang 3.2 release notes:
Clang parses the comments and can detect syntactic and semantic errors in comments. These warnings are off by default. Pass -Wdocumentation flag to enable warnings about documentation comments.
If you want to see an example of this new feature I recommend you take a look at the following article: Documentation in Xcode 5

- 6,958
- 2
- 31
- 42
-
1Take a look at [this answer](http://stackoverflow.com/a/19169271/991816). It lists all supported commands. – DanSkeel Apr 24 '15 at 01:29
I don't know what IDE you're using but doxygen lets you generate documentation from comments in Objective-C (as well as C, C++, Java, and some others).
If you're using Xcode (just assuming, since you're using Objective-C), there does seem to be some level of integration (not tested by me, just found on Google): http://developer.apple.com/tools/creatingdocsetswithdoxygen.html

- 8,285
- 3
- 19
- 32

- 26,726
- 31
- 139
- 202
The standard way, as @DiegoPalomar suggested, is to use HeaderDoc, Apple's own tool for embedding structured comments in source code.
It comes with Xcode, so no installation required. It comes with a command-line script that generates HTML output of your documentation.
Docs for HeaderDoc:
Here's an example:
/*!
* Takes in a number and adds 4 to it.
*
* @param myNumber a number of type NSInteger.
*
* @return The number with 4 added to it.
*/
- (NSInteger)addFour:(NSInteger)myNumber {
return myNumber + 4;
}
Big plus: when you alt-click on your documented method, your doc appears in the balloon:
HeaderDoc is open-source too: http://www.opensource.apple.com/source/headerdoc/

- 16,003
- 15
- 87
- 139