问题
I am trying to run a simple project with the following:
@Published var currentPlacemark: CLPlacemark? = nil
- XCode11 Beta5(11M382q)
- iOS13(17A5556d)
Getting the following error:
dyld: Symbol not found: _$s7Combine9PublishedV9PublisherCyx_GAadAM
Anyone else encountered this?
Code example:
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
回答1:
It's a bug of the versions that you mentioned, I had the same issue. To solve it update to the new betas:
- Xcode 11 beta 6 (11M392q)
- iOS 13 beta 7 (17A5565b)
来源:https://stackoverflow.com/questions/57481380/combine-published-could-not-be-found-xcode11-beta-511m382q