【问题标题】:Xcode 13: `Value of type 'NSPersistentCloudKitContainerOptions' has no member 'databaseScope'`Xcode 13:`'NSPersistentCloudKitContainerOptions' 类型的值没有成员'databaseScope'`
【发布时间】:2021-09-23 06:07:40
【问题描述】:

升级到 Xcode 13.0 (13A233) 后,以下代码曾用于 Xcode 12

let publicOptions = NSPersistentCloudKitContainerOptions(containerIdentifier: containerIdentifier)
publicOptions.databaseScope = .public

产生错误:Value of type 'NSPersistentCloudKitContainerOptions' has no member 'databaseScope'

事实上,当我点击NSPersistentCloudKitContainerOptions 时,它会显示没有databaseScope 的旧(iOS 13)版本的CoreData 框架。

我的部署目标是 iOS 14,它曾经与 Xcode 12 一起工作了很长时间。此外,它现在在几个项目中被破坏,包括使用 Xcode 12 创建的项目,即最近。 如何解决这个问题?

【问题讨论】:

    标签: xcode core-data xcode13


    【解决方案1】:

    显然,现在还需要import CloudKit 才能使databaseScopeCoreDataNSPersistentCloudKitContainerOptions 类中可用。

    【讨论】:

      猜你喜欢
      • 2019-08-14
      • 2021-01-05
      • 2019-07-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-07
      相关资源
      最近更新 更多