CoreData通过退出保存对象更改 [英] CoreData Saving Object Changes by Quit

查看:100
本文介绍了CoreData通过退出保存对象更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题引用了这个问题(代码可以在这里看到): 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆