Xcode documentation comment syntax

362 views Asked by At

I was wondering if someone could explain what/if there is any difference between the following two comment syntax in Xcode.

/**
 * comments
 */

/*!
 * comments
 */

It seems like both allow Xcode to display your comments as documentation but I'm not sure if there is a difference between the two.

2

There are 2 answers

0
sbooth On BEST ANSWER

They are functionally equivalent. /*! is a HeaderDoc style opener and /** is a JavaDoc style opener commonly used by doxygen. Xcode 5 supports both HeaderDoc and doxygen/JavaDoc formats.

0
Midhun MP On

Both are equivalent by functionality.

Differences:

/**

  1. Doxygen style
  2. If you use headerdoc2html command, the /** based comments won't be present in the documentation file, it'll skip those comments (Refer HeaderDoc not generating HTML Documentation)

/*!

  1. HeaderDoc style
  2. If you use headerdoc2html command the /*! comments will be displayed on the documentation file in HTML format unlike /**