문제

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