質問

When I use comment like this

/* style 1 */
NSMutableArray *wayPoints;   ///Player's wayPoints ARRAY
CGPoint        velocity;     ///Player's current speed and direction

Code documentation doesn't work. But when I code like this.

/* style 2 */
///Player's wayPoints ARRAY
NSMutableArray *wayPoints;
///Player's current speed and direction
CGPoint        velocity;

It works. But it doesn't looks clear.

So how can I use like /* style 1 */

役に立ちましたか?

解決

Although both styles are appropriate... It is better to use /* Style 1 / for variable declarations or assignments, where line of code is small, and use / style 2 */ for commenting methods or functions, where line of code is large.

他のヒント

yes use this /* your code for comment */ for multi line comment, use // this for single line comment and both are working for me in xcode 5

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top