CoreStore error swift4 undeclared type

时间:2018-06-04 16:51:12

标签: swift

iam trying to create object and insert this data inside it using CoreStore but it gives me an error

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)
        }
    })

The error happen let user = transaction.create(Into()) undeclared type "Heros"

Any suggestion ?

thanks

0 个答案:

没有答案