CoreData通过退出保存对象更改 [英] CoreData Saving Object Changes by Quit
问题描述
这个问题引用了这个问题(代码可以在这里看到): TO THE问题
This question takes reference to this one (code can be seen there): TO THE QUESTION
如果我创建几个新对象,我可以与他们合作,在他们之间切换等。一切正常。但是,如果完全关闭应用程序(在iOS5多任务栏)并再次打开它,我得到了我创建的对象的数量,但所有的属性都设置为标准值。这是所有对象除了一个之外的情况:位于列表顶部的对象。我忘记了任何地方的保存命令吗?感谢!
If I create a few new Objects, I can work with them, change between them etc. Everything works. But if a close the app completely (in the iOS5 Multitasking Bar) and open it up again, I got the number of objects I created, but all of the attributes are set to the standard values. That is the case with all objects except of one: The one which stands on top of the list. Did I forget a save command anywhere? Thanks!
推荐答案
尝试在 saveContext
> applicationWillResignActive 。
Try to call saveContext
in applicationWillResignActive
.
这篇关于CoreData通过退出保存对象更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!