gpt4 book ai didi

swift - "Cannot inherit from non-open class" swift

转载 作者:IT王子 更新时间:2023-10-29 05:06:29 27 4
gpt4 key购买 nike

从 Xcode 8 beta 6 开始,我现在在其定义模块之外收到编译错误“无法从非开放类 (Class) 继承”

我继承的类是单独的 Swift 框架的一部分,但我的项目是为 Xcode 8 beta 5 编译的。我需要更改什么才能让我的项目再次编译?

最佳答案

我自己找到了答案。

在 Swift 3 中,您现在可以将类标记为 open 而不是 public 这允许模块外部的文件子类化该类。

只需将模块类中的 public 替换为 open

引用 here .

关于swift - "Cannot inherit from non-open class" swift ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38979371/

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