swift - CoreStore错误swift4未声明类型
问题描述
我正在尝试使用 CoreStore 创建对象并在其中插入此数据,但它给了我一个错误
let dataStack: DataStack = {
let dataStack = DataStack(xcodeModelName: "ModelName")
do {
try dataStack.addStorageAndWait(SQLiteStore(fileURL: fileURL, configuration: "Default", localStorageOptions: .
recreateStoreOnModelMismatch))
} catch let error {
print("Cannot set up database storage: \(error)")
}
return dataStack
}()
dataStack.perform(
asynchronous: { (transaction) -> Void in
let user = transaction.create(Into<Heroes>()) // undeclared type "Heros"
user.time = self.timest
user.token = self.qrrec
user.type = "QR"
user.midass = self.midaaas
}, completion: { (result) -> Void in
switch result {
case .success: print("success!")
case .failure(let error): print(error)
}
})
发生错误让 user = transaction.create(Into()) 未声明类型“英雄”
有什么建议吗?
谢谢
解决方案
推荐阅读
- julia - 引用表达式中的 Julia 全局变量抛出 UndefVarError
- dll - CLion内置的库不能动态连接到另一个项目
- r - 我的 Sankey 图(R,Plotly)的标签在我的 Shiny 仪表板的在线版本上没有正确显示,但在本地表现正确
- visual-studio - Visual Studio,GLUT 错误 - 以下是 GLUT 3.0 的新检查;更新您的代码。窗口 1 需要重新显示,但没有显示回调
- javascript - Typescript / JavaScript 比较未定义的值
- python - Seaborn 热图 - 多个变量
- r - R 中的数据清理 - 只需从列中取出数字
- javascript - 浏览器端 JS:文件系统 API 与文件系统访问 API?
- spring-boot - HttpServer tcpConfiguration 已弃用
- nuxt.js - 如何使用保存在 Nuxt 商店中的 Vuetify 选择值修复不匹配的子节点?