gpt4 book ai didi

IOS 13 Combine Framework - @Published 不工作 ("Unknown attribute ' Published'")

转载 作者:IT王子 更新时间:2023-10-29 05:41:36 24 4
gpt4 key购买 nike

我观看了 WWDC 2019 session “结合实践”(https://developer.apple.com/videos/play/wwdc2019/721/)。

在视频中,他们使用以下语法创建发布者:

@Published var someName: String = ""

他们这样做是为了让 someName 成为发布者。然而,Xcode 不喜欢这种语法并给我一个错误:

Unknown attribute 'Published

我不知道为什么。我在 macOS Catalina 上使用 Xcode 11 beta。

有什么想法吗?

最佳答案

来自Xcode 11 Beta Release Notes (强调):

The Foundation integration for the Combine framework is unavailable. The following Foundation and Grand Central Dispatch integrations with Combine are unavailable: KeyValueObserving, NotificationCenter, RunLoop, OperationQueue, Timer, URLSession, DispatchQueue, JSONEncoder, JSONDecoder, PropertyListEncoder, PropertyListDecoder, and the @Published property wrapper. (51241500)


更新:这已在 Xcode 11 beta 2 中修复。来自 Xcode 11 Beta 2 Release Notes :

Resolved Issues

The Foundation integration for the Combine framework is now available. The following Foundation and Grand Central Dispatch integrations with Combine are available: KeyValueObserving, NotificationCenter, RunLoop, OperationQueue, Timer, URLSession, DispatchQueue, JSONEncoder, JSONDecoder, PropertyListEncoder, PropertyListDecoder, and the @Published property wrapper. (51241500)

关于IOS 13 Combine Framework - @Published 不工作 ("Unknown attribute ' Published'"),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56522258/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com