Objective-C方法描述(doc评论)

Objective-C方法描述(doc评论),第1张

概述我正在学习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;
解决方法 更新:以下格式适用于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评论)所遇到的程序开发问题。

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

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/web/1070923.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-26
下一篇 2022-05-26

发表评论

登录后才能评论

评论列表(0条)

保存