7

I just found this comment declaration in some xcode sample project:

/*!
@property masterVolume
@abstract Sets the master volume
*/
@property float masterVolume;

The comment is green as usual, the @property and @ abstract are dark green. If I remove the exclamation mark, they have the same green. What the heck does that mean?

Faser
  • 1,216
  • 18
  • 35

3 Answers3

5

To make transition from headerdoc a bit simpler, appledoc (tool to generate documentation from code so you save time in documentation) also accepts headerdoc style multiline comments:

/*! Comment */

Source

Andre Holzner
  • 17,661
  • 6
  • 53
  • 61
Farrukh Subhani
  • 1,958
  • 1
  • 15
  • 23
  • So basically, if I have appledoc, that is going to use that comment to write a documentation? nice :) – Faser Oct 10 '11 at 16:38
3

In Objective-C, a comment is only delimited by /* */, so you are right, the exclamation point is not necessary to form a comment. However, in this case, the ! there is to say that that commment should be read by an auto-documentation tool, such as Doxygen or AutoDoc. The same goes for the @ symbols there. @property is saying that you are documenting a property called masterVolume and @abstract is describing what the property is for.

DeM0nFiRe
  • 185
  • 4
3

It's a Qt comment style. It is treated as a block comment by doxygen, Headerdoc, and Appledoc. The author was familiar with Qt programming and chose that comment style. He could have chosen /** instead, just a matter of taste.

albert
  • 7,283
  • 3
  • 16
  • 31
Jano
  • 61,767
  • 21
  • 157
  • 186