I've checked the answers here on SO and google and am stumped.
func saveAvailableWord(word: GameWord) {
let gw = NSEntityDescription.insertNewObjectForEntityForName("GameWord", inManagedObjectContext: persistence.managedObjectContext!) as! NSManagedObject
let rId = word.rowID
gw.setValue(rId, forKey: "rowID") //*** Error line
}
The code above is for core data and simply tries to create an object. But I get
"Cannot invoke 'setValue' with an argument list of type '(Int64, forKey: String)'
on the marked line. rowID is defined as @NSManaged var rowID: Int64
because it is coming from an SQLite ROWID column.
If I replace the rId variable with a simple number the error goes away. What am I missing? What am I doing wrong?
Thanks for your time and help.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…