Data not saved between sessions!?


#1

Ooops - I see now that the previous post deals with exactly this issue.

/MickeDG

Hi!

Thanks for a great book - I’ve now worked through all chapters up until this one (27) and learning a lot all the way!

I’m confused here - isn’t one of the benefits with using Core Data that I get persistence between application runs? I’ve completed the Inventory application and it seems to run as it should but all data is lost from one run to another (after i make sure that the application is terminated).

Am I missing something here??

Best regards,
MickeDG


#2

I looked a bit more at this and it seems that my Inventory application starts up with reading data but can’t find any. And I can’t see that it writes any data when I quit the application…what controls the saving to a SQLite file?

BR,
MickeDG

Application start:

GNU gdb 6.3.50-20050815 (Apple version gdb-1518) (Sat Feb 12 02:56:02 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type “show copying” to see the conditions.
There is absolutely no warranty for GDB. Type “show warranty” for details.
This GDB was configured as “–host=x86_64-apple-darwin --target=arm-apple-darwin”.tty /dev/ttys000
target remote-mobile /tmp/.XcodeGDBRemote-278-62
Switching to remote-macosx protocol
mem 0x1000 0x3fffffff cache
mem 0x40000000 0xffffffff none
mem 0x00000000 0x0fff none
[Switching to process 11779 thread 0x0]
[Switching to process 11779 thread 0x0]
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3.3 (8J2)/Symbols/System/Library/AccessibilityBundles/AccessibilitySettingsLoader.bundle/AccessibilitySettingsLoader (file not found).
2011-05-20 11:31:30.424 Inventory[462:707] CoreData: annotation: Connecting to sqlite database file at "/var/mobile/Applications/2B5BACDA-1747-43FC-B26E-8CBA98A134E1/Documents/Inventory.sqlite"
2011-05-20 11:31:30.441 Inventory[462:707] CoreData: sql: pragma cache_size=200
2011-05-20 11:31:30.449 Inventory[462:707] CoreData: sql: SELECT Z_VERSION, Z_UUID, Z_PLIST FROM Z_METADATA
2011-05-20 11:31:30.464 Inventory[462:707] CoreData: sql: SELECT 0, t0.Z_PK, t0.Z_OPT, t0.ZLABEL FROM ZLOCATION t0 ORDER BY t0.ZLABEL
2011-05-20 11:31:30.472 Inventory[462:707] CoreData: annotation: sql connection fetch time: 0.0076s
2011-05-20 11:31:30.477 Inventory[462:707] CoreData: annotation: total fetch execution time: 0.0126s for 0 rows.

Application end:

2011-05-20 11:38:45.563 Inventory[462:707] CoreData: annotation: total fetch execution time: 0.0072s for 0 rows.
2011-05-20 11:38:55.122 Inventory[462:707] CoreData: sql: SELECT 0, t0.Z_PK, t0.Z_OPT, t0.ZLABEL FROM ZASSET t0 ORDER BY t0.ZLABEL
2011-05-20 11:38:55.128 Inventory[462:707] CoreData: annotation: sql connection fetch time: 0.0057s
2011-05-20 11:38:55.131 Inventory[462:707] CoreData: annotation: total fetch execution time: 0.0087s for 0 rows.
2011-05-20 11:38:58.070 Inventory[462:707] CoreData: sql: SELECT 0, t0.Z_PK, t0.Z_OPT, t0.ZLABEL FROM ZASSET t0 ORDER BY t0.ZLABEL
2011-05-20 11:38:58.075 Inventory[462:707] CoreData: annotation: sql connection fetch time: 0.0044s
2011-05-20 11:38:58.077 Inventory[462:707] CoreData: annotation: total fetch execution time: 0.0071s for 0 rows.
2011-05-20 11:39:00.140 Inventory[462:707] CoreData: sql: SELECT 0, t0.Z_PK, t0.Z_OPT, t0.ZLABEL FROM ZASSET t0 ORDER BY t0.ZLABEL
2011-05-20 11:39:00.145 Inventory[462:707] CoreData: annotation: sql connection fetch time: 0.0046s
2011-05-20 11:39:00.149 Inventory[462:707] CoreData: annotation: total fetch execution time: 0.0086s for 0 rows.
2011-05-20 11:39:12.622 Inventory[462:707] CoreData: annotation: Disconnecting from sqlite database.