【问题标题】:In Xcode 5, how can I use comment ///在 Xcode 5 中,如何使用注释 ///
【发布时间】:2014-05-06 13:32:36
【问题描述】:

当我使用这样的评论时

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

代码文档不起作用。 但是当我这样编码时。

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

它有效。 但看起来不是很清楚。

那么我该如何使用/* style 1 */

【问题讨论】:

  • 您可以使用VVDocumenter-Xcode 插件在您键入/// 时自动编写正确的cmets。最简单的方法是通过Alcatraz 安装它。

标签: objective-c xcode comments xcode5


【解决方案1】:

虽然这两种风格都合适... 最好将 /* Style 1 / 用于变量声明或赋值,其中代码行较小,使用 / style 2 */ 用于注释方法或函数,其中代码行较大。

【讨论】:

  • 对我来说 /* 样式 1 / 和 / 样式 2 */ 都在 xcode 5 中工作。
【解决方案2】:

是的,使用这个 /* 你的代码用于注释 */ 用于多行注释, 使用 // this 作为单行注释,两者都在 xcode 5 中为我工作

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-03
    • 1970-01-01
    • 2017-07-12
    • 2023-03-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多