代码注释的格式

1.先写一下个个字段对应的意思

/*!

 @header     文件名

 @abstract   简介,概念

 @discussion 用途,方法

 @copyright  版权

 */

给出一个模版

/*!

 @header     MFMailComposeViewController

 @abstract   The MFMailComposeViewController class provides an interface for editing and sending email.

 @discussion MFMailComposeViewController is used for implementing a simple interface for users to enter

 and send email.

 @copyright  Copyright 2008, 2009 Apple Inc. All rights reserved.

 */

2.第二种注释,用于介绍枚举类型

/*!

 @enum       MFMailComposeResult

 @abstract   Composition result sent to the delegate upon user completion.

 @discussion This result will inform of the user's choice in regards to email composition.  If the user

 cancels the composition, <tt>MFMailComposeResultCancelled</tt> will be sent to the delegate.

 Typically <tt>MFMailComposeResultSent</tt> or <tt>MFMailComposeResultSaved</tt> will

 be sent, but <tt>MFMailComposeResultFailed</tt> will be sent in the case of failure.

 </p>Send may only be interpreted as a successful queueing of the message for later sending.

 The actual send will occur when the device is able to send.

 @constant   MFMailComposeResultCancelled   User canceled the composition.

 @constant   MFMailComposeResultSaved       User successfully saved the message.

 @constant   MFMailComposeResultSent        User successfully sent/queued the message.

 @constant   MFMailComposeResultFailed      User's attempt to save or send was unsuccessful.

 */

enum MFMailComposeResult {

    MFMailComposeResultCancelled,

    MFMailComposeResultSaved,

    MFMailComposeResultSent,

    MFMailComposeResultFailed

};

typedef enum MFMailComposeResult MFMailComposeResult;

3.不可改变量的注释

/*!

 @const      MFMailComposeErrorDomain

 @abstract   Error domain for NSError values stemming from the MFMailCompose API.

 @discussion This error domain is used as the domain for all NSError instances stemmming from the

 MFMailCompose API.  Valid error code values are declared in the <tt>MFMailComposeErrorCode</tt>

 space.

 */

extern NSString *const MFMailComposeErrorDomain ;

4.一个类的注释

/*!

 @class       MFMailComposeViewController

 @abstract    The MFMailComposeViewController class provides an interface for editing and sending email.

 @discussion  The MFMailComposeViewController class manages all user interaction.  The client needs to set the recipient or

 recipients.  The client may also set the subject and the body of the message.  Attachments may be added, if

 so desired.  After setup, the client needs to only display the view.</p>The provided delegate will be informed

 of the user's composition completion and how they chose to complete the operation.<p>Prior to use, clients

 should verify the user has set up the device for sending email via <tt>+[MFMailComposeViewController canSendMail]</tt>.

 */

@interface MFMailComposeViewController : UINavigationController

{

@private

    id _internal;

}


5.一个方法的注释

/*!

 @method     setSubject:

 @abstract   This method sets the Subject header for the email message.

 @discussion This method will set the Subject header for the email message.  This should be called prior to display.

 </p>After the view has been presented to the user, this method will no longer change the value.

 @param      subject  A NSString specifying the message's Subject header.

 */

- (void)setSubject:(NSString *)subject;

6.一个属性的注释

/*!

 @property   mailComposeDelegate

 @abstract   This property is the delegate for the MFMailComposeViewControllerDelegate method callbacks.

 */

@property(nonatomic,assignid<MFMailComposeViewControllerDelegate> mailComposeDelegate /

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值