swift - 旧核心数据同步到 CloudKit “iCloud”
问题描述
我有一个使用 Core Data 的应用程序,但现在我将 CloudKit 添加到我的应用程序中,并且在同步所有旧的 Core Data 时遇到了问题。有没有人有同样的问题?有谁知道如何同步旧的核心数据?
func fetch(completion: (_ comple: Bool) -> ()) {
guard let managedContext = appDelegate?.persistentContainer.viewContext else { return }
let fetchRequest = NSFetchRequest<Goal>(entityName: "Goal")
do {
goalPasswords = try managedContext.fetch(fetchRequest)
completion(true)
} catch {
debugPrint("Fetch Error \(error.localizedDescription)")
completion(false)
}
}
解决方案
推荐阅读
- php - 使用 php mysql 插入后如何获取列值?
- .htaccess - 如何通过 htaccess 使用 301 重定向将多个旧网址重定向到新网址
- java - ORA-22922: 将 CLOB 作为 UDT 数组的一部分传递时 LOB 值不存在
- excel - Font.ColorIndex 在输入和输出中不一致
- string - 调用字符串 symfony 3.4 上的成员函数 format()
- ios - 在 intune 托管设备上使用 Microsoft 帐户进行外部登录失败
- python - SQLAlchemy union_all 和 all() 返回不正确的项目数
- python - Python 访问字典内的字典返回扭曲的字典
- regex - 匹配跳过字符的出现次数
- javascript - Firmata.js - serialRead()的问题