gpt4 book ai didi

iphone - Objective-C 方法评论

转载 作者:太空狗 更新时间:2023-10-30 03:14:07 25 4
gpt4 key购买 nike

为 Objective-C 注释方法的正确方法是什么?例如,在 .Net 中,我会添加一个 xml 注释,例如:

/// <summary>
/// Summary of method
/// </summary>
/// <param name="FileName">The document's original filename.</param>
/// <returns>Decoded filename</returns>

是否有 Objective-C 的等效项?

最佳答案

不要忘记用于阻止代码的 pragma 标记。它帮助 XCode 分离下拉列表中的方法。它还在视觉上分解了您的源文件,使其更易于阅读。

以下是我如何屏蔽部分代码:

///////////////////////////////////////////////////////////////////////////
#pragma mark -
#pragma mark View Lifecycle
#pragma mark -
///////////////////////////////////////////////////////////////////////////

- (void) functionsHere

它最终在 XCode 中这样做:

enter image description here

关于iphone - Objective-C 方法评论,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7493931/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com