I have an Xcode project that doesn t use self.
inside of a closure where it s needed.
class Example {
func bar() {
DispatchQueue.main.async { [weak self] in
guard let self = self else {
return
}
print(foo) // should be print(self.foo), but not getting an error here
}
}
var foo: String {
"foo"
}
}
尽管如此,该建筑仍在当地成功。 我预计以下错误也会在当地出现:
提及关闭时的财产oo,需要明确使用自我,以明确捕捉 se
我的环境