18 May 2010

Storing Data

Chapter 8 (Handling Data) ends with a discussion of how you can store and retrieve data in your iPhone apps, including a nice modification to the CityGuide app on pages 219-224, using SQLite. I almost got the modification working, but had problems when I made an error in my citites.sqlite file. I deleted the previous cities.sqlite from my Resources, added the new file, and still got the old data. It turns out that to really "clean" your app data, you need to remove the old version of cities.sqlite (or whatever data file you're using) from /Users/yourname/Library/Application Support/iPhone Simulator/3.1.3/Applications/bigrandomkey/Documents/. (The bigrandomkey is just an arbitrary code that the simulator uses to generate temporary directories in which to store your data.)

1 comment:

  1. When you deleted the sqlite file from Resources, you might not have ticked the 'also move to recycling bin' (or whatever it says) option.

    I was pretty confused about what the author was talking about in this section, but you can download a folder with the eatblob.c and the associated detdelim and getline functions. Downloading that folder makes it a lot easier to compile, rather than going to the sourceforge.net page.

    ReplyDelete