3

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.

strikerdude10
  • 663
  • 6
  • 15

2 Answers2

4

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.

albert
  • 8,285
  • 3
  • 19
  • 32
sbooth
  • 16,646
  • 2
  • 55
  • 81
0

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 /**
Community
  • 1
  • 1
Midhun MP
  • 103,496
  • 31
  • 153
  • 200