CoreData Saving Object Changes by Quit

折月煮酒 提交于 2019-12-08 10:50:31

问题


This question takes reference to this one (code can be seen there): TO THE QUESTION

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!


回答1:


Try to call saveContext in applicationWillResignActive.



来源:https://stackoverflow.com/questions/8049696/coredata-saving-object-changes-by-quit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!