I usually need to write many short code in code comment like this
. Is this possible to use in Apple's Headerdoc? Because this type of code notation is generally used heavily, so i believe there's a convenient way to do this instead of marking HTML tags.
Asked
Active
Viewed 960 times
7

eonil
- 83,476
- 81
- 317
- 516
5 Answers
4
Within your HeaderDoc, you can use this formatting:
@code
// code text
while (someCondition) {
NSLog(@"Hello");
doSomething();
}@endcode
Last line text.
-
1It doesn't seem to work: `Unknown field type @code in HeaderDoc comment.` – ctn Jul 23 '15 at 11:05
1
@code
and @c
don't seem to work as of Headerdoc 8.9.
I ended up using:
<pre>@textblock
@/textblock</pre>

ctn
- 2,887
- 13
- 23
1
I'm on Xcode 6.4/HeaderDoc 8.9 and neither @code
nor @c
work. <pre>code</pre>
works but adds newlines.
I ended up being able to produce inline code snippets by using <tt>code</tt>
(teletype text).

dvs
- 12,324
- 6
- 38
- 45