【问题标题】:swift_class_getInstanceExtents doesn't appear in XCode - how do you call it?swift_class_getInstanceExtents 没有出现在 XCode 中——你怎么称呼它?
【发布时间】:2016-03-24 07:29:44
【问题描述】:

任何人都知道你的称呼:

swift_class_getInstanceExtents

它在:

https://github.com/apple/swift/blob/master/stdlib/public/core/Builtin.swift

但在 XCode 中不显示。

【问题讨论】:

    标签: swift


    【解决方案1】:

    几件事:

    该开源 Swift 文件中的其他方法被明确声明为 publicinternal,所以我认为像“swift_class_getInstanceExtents”这样的未修饰函数声明可能不会公开。

    另外,我发现了这篇有趣的博文,上面写着"the Builtin module in swift is actually only available to stdlib and not normal Swift programs"(我猜这就是你在这里想要做的)。

    【讨论】:

      【解决方案2】:

      关于 swift-users 的 Joe Groff 为我回答了这个问题。您添加:

      @_silgen_name("swift_class_getInstanceExtents") func swift_class_getInstanceExtents(theClass: AnyClass) -> (negative: UInt, positive: UInt)
      

      到你的文件,然后你可以调用 swift_class_getInstanceExtents。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-01-16
        • 2010-11-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-11-15
        相关资源
        最近更新 更多