Objective-C 注释技巧

Objective-C注释技巧

  • //单行注释
  • /* 多行注释 */

注释实例说明(VVDocumenter推荐注释格式)

/**
*  设置个人信息
*
*  @param name    姓名
*  @param address 地址
*
*  @return NSString
*/
- (NSString *)personName:(NSString *)name address:(NSString *)address
{
  return @"";
}

图例1

标注实例说明

示例1(-分割线)

#pragma mark - 标注
- (NSString *)personName2:(NSString *)name address:(NSString *)address
{
   return @"";
}

示例2

// MARK: 标注
- (NSString *)personName3:(NSString *)name address:(NSString *)address
{
   return @"";
}

TODO实例说明

// TODO: 标注
- (NSString *)personName4:(NSString *)name address:(NSString *)address
{
   return @"";
}

FIXME实例说明

// FIXME: 标注
- (NSString *)personName5:(NSString *)name address:(NSString *)address
{
    return @"";
}

!!!实例说明

// FIXME: 标注
- (NSString *)personName5:(NSString *)name address:(NSString *)address
{
    return @"";
}

???实例说明

// FIXME: 标注
- (NSString *)personName5:(NSString *)name address:(NSString *)address
{
    return @"";
}

图例2

在 “Objective-C 注释技巧” 上有 2 条评论

  1. Generally I don’t read article on blogs, but I wish to say that this write-up very forced me to try and do it! Your writing style has been amazed me. Thanks, quite nice post.

发表评论

电子邮件地址不会被公开。 必填项已用*标注