我正在尝试使用以下内容运行一个简单的项目:
@Published var currentPlacemark: CLPlacemark? = nil
出现以下错误:
dyld: Symbol not found: _$s7Combine9PublishedV9PublisherCyx_GAadAM
还有其他人遇到过吗?
代码示例:
import SwiftUI
import Combine
class MyFoo {
@Published var bar: String = ""
}
struct ContentView: View {
var body: some View {
Text("Hello World")
}
}
#if DEBUG
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
let foo = MyFoo()
foo.bar = "asas"
let barSink = foo.$bar
.sink() {
print("bar value: \($0)")
}
return ContentView()
}
}
#endif
答案 0 :(得分:1)
这是您提到的版本的错误,我遇到了同样的问题。要解决此问题,请更新到新的Beta: