【发布时间】:2017-02-14 01:03:28
【问题描述】:
项目是我的 NSManagedObject
let proj = Project(context: context!)
//at this point when i try to fetch for my proj nothing is there
proj.title = "title"
//at this point I can fetch my project record
现在我试试
let proj = Project(context: context!)
let proj1 = Project(context: context!)
//at this point when i try to fetch for my proj nothing is there
proj.title = "title"
//I find 1 record
我稍微修改一下代码
let proj = Project(context: context!)
let proj1 = Project(context: context!)
//when i try to fetch for my proj nothing is there
proj.title = "title"
proj1.title = "title"
//I find 2 record
好像 proj.title = "title" 正在保存记录
我的子类中没有 .save()
这是为什么?我很困惑
我认为对象仅在您调用时才保存 managedObjectContext.save
【问题讨论】: