【问题标题】:@availability keyword not working in Xcode "alt+click" documentation helper@availability 关键字在 Xcode“alt+click”文档助手中不起作用
【发布时间】:2014-05-14 10:01:32
【问题描述】:

我正在尝试记录我的头文件,我真的很喜欢 alt+click 文档助手的概念。 使用下面的代码,我可以设置 @param@return@see 等关键字,但不幸的是 @availability 没有以正确的方式显示。

/**
 * Super method for super feature
 *
 * @param someParameter super cool method parameter
 *
 * @availability Version 3.0 (and later)
 *
 * @return void
 */

问题是:如何在文档助手中设置可用性参数?

【问题讨论】:

  • 你清理并重建了吗?
  • 这里有问题吗?
  • 清理和重建没有帮助。 @GuyKogus:已编辑 :)

标签: ios xcode documentation xcode5


【解决方案1】:

您正在寻找@since,而不是@availability

有关命令的完整列表,请参阅this question

【讨论】:

    【解决方案2】:

    您需要使用NS_AVAILABLE_IOS(5_0) 来显示可用性。
    这是一个例子:

    /**
     Check whether a file at a given URL has a newer timestamp than a given file.
     Example usage:
     @code
     NSURL *url1, *url2;
     BOOL isNewer = [FileUtils
     isThisFileNewerThanThatFile:url1 thatURL:url2];
     @endcode
     @param index
     The index
     @return the results
     */
    - (UIImage*)imageForSectionIndex:(NSUInteger)index NS_AVAILABLE_IOS(6_0){
       // your implem
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-01-22
      • 1970-01-01
      • 2022-08-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多