找不到合并@Published-Xcode11 Beta 5(11M382q) [英] Combine @Published could not be found - Xcode11 Beta 5(11M382q)

查看:57
本文介绍了找不到合并@Published-Xcode11 Beta 5(11M382q)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用以下内容运行一个简单的项目:

I am trying to run a simple project with the following:

@Published var currentPlacemark: CLPlacemark? = nil

  • XCode11 Beta5(11M382q)
  • iOS13(17A5556d)

出现以下错误: 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

推荐答案

这是您提到的版本的错误,我遇到了同样的问题.要解决此问题,请更新到新的Beta:

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)

这篇关于找不到合并@Published-Xcode11 Beta 5(11M382q)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆