iOS   发布时间:2022-05-04  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Objective-C方法描述(doc评论)大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

我正在学习Objective-C,需要知道如何编写方法描述。我在Objective-C中学习如何做到这一点很困难。 在耶夫我们有这个 /** < h2 >MethodName</ h2 > < p >Various Description, can use html with images etc.</ p > */ private void methodName(args[]..) { } 在
我正在学习Objective-C,需要知道如何编写方法描述。我在Objective-C中学习如何做到这一点很困难。

在耶夫我们有这个

/**
< h2 >MethodName</ h2 >
< p >VarIoUs Description,can use html with images etc.</ p >
*/
private void methodName(args[]..)
{

}

在目标c中,我在哪里放置说明?这也是在头文件或实现文件中?

//Within Implementation?
- (float)gteHeightPercentage:(float)percentageToGet
{
    return self.view.bounds.size.height * percentageToGet;
}

//Within Header?
- (float)getWidthPercentage:(float)percentageToGet;

解决方法@H_675_32@
更新:以下格式适用于Objc。如果要记录swift代码,请参阅 NSHipster’s blog about Swift Documentation

XCode 5可以做你想要的感谢Wonil Kim,在.h文件中:

/** 
 * Add new message between source to desTination timeline as empty name String
 * @author Wonil Kim
 *
 * @param sourcEID source timeline entity ID
 * @param destId DesTination timeline entity ID
 * @return A newly created message instance
 */
- (ISmessage*)messageFromTimeline:(NSInteger)sourcEID toTimeline:(NSInteger)destId;

一旦完成,你可以选择点击方法名称,和..violà!

当然,从Kim’s blog可以看出,这不是唯一的办法:

/*! Some description of the method....
 * \returns  The result
 */

或者,

/// Some description to show up,done by:
/// @author  Olly Dixon

你得到了点…

正如许多已经提到的那样,Objective-C不会向您显示您的文档;其实也不是java(javadoc,可能是)。这是你的IDE,在这种情况下,不可崩溃的Xcode

大佬总结

以上是大佬教程为你收集整理的Objective-C方法描述(doc评论)全部内容,希望文章能够帮你解决Objective-C方法描述(doc评论)所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。