相关疑难解决方法(0)

声明不能同时是Swift 1.2中的"最终"和"动态"错误

声明value如下

import Foundation

class AAA: NSObject {
    func test2() {
        self.dynamicType
    }
}
extension AAA {
    static let value    =   111
}
Run Code Online (Sandbox Code Playgroud)

导致以下编译错误

A declaration cannot be both 'final' and 'dynamic'
Run Code Online (Sandbox Code Playgroud)

为什么会发生这种情况,我该如何处理?

我使用的是Swift 1.2(Xcode 6.3.1 6D1002中提供的版本)

compiler-errors swift

123
推荐指数
5
解决办法
1万
查看次数

标签 统计

compiler-errors ×1

swift ×1