0
項目是我的NSManagedObjectCoreData保存記錄,而不contextsave
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 =「標題「正在保存記錄
I在我的子類中沒有.save()
這是爲什麼?我很困惑
我以爲對象只保存,當你調用 managedObjectContext.save