Combine @Published could not be found - Xcode11 Beta 5(11M382q)

萝らか妹 提交于 2019-12-02 15:16:20

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!