我是 swift 的新手。我想在下面是我的代码的静态函数中使用 swift 类的非静态成员。我无法在静态函数中访问类的非静态成员。有没有办法在 swift 函数中访问非静态成员?
public class Test{
private let testString:String
init(test:String){
testString = test
}
static func Get(url:String){
//Here testString is not accessable..
}
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2037 次 |
最近记录: |