John Doe
John Doe

Reputation: 2491

Xcode not formatting document comment properly for Objective-C code

I added the following comment with backtick for code:

/** Checks if the given data is of type `list`. */
+ (BOOL)isList:(id)object {
    // ..
}

but the backtick prints as in the Xcode quick help:

enter image description here

How to get Xcode to display code formatted properly? It works fine when documenting Swift source.

Upvotes: 4

Views: 689

Answers (1)

R4N
R4N

Reputation: 2595

As discussed in the comments above, in Objective-C documentation comments you can use @p or @c to display Typewriter font in the QuickHelp documentation. Whereas Swift documentation comments accept Markdown (using the backticks)

While this answers is relatively old, it still lists a good amount of the options available in Objective-C documentation comments: https://stackoverflow.com/a/19169271/7833793

Here's a brief example:

/// Here's how to use @c Typewriter @c Font
- (void)myMethod {}

Which displays this in the QuickHelp: enter image description here

Upvotes: 3

Related Questions