views:

117

answers:

2

I need to store an array of user created objects (a user enters data for several properties and then commits it), and I need it to be available in a database or something similar so that I can call it up and display the data when the user calls for it even after the user quits the program(the persistent part).

Other considerations are I'd like to be able to translate the objects into a human readable spreadsheet / googledoc / email / table at the users request. As far as redisplaying the object, I'll be using a two stage uitableview, stage 1: a list of the users objects and then stage 2: a drill down into the details of the object.

I've been looking at coreData but not sure if it's suited(overkill?) and I'm wondering if storing an array in nsuserdefaults is too wimpy.

Basically I'm looking for the simplest way to do this that will actually scale if I build out this app more.

Thanks,

Nick

+4  A: 

You have three basic strategies:

  1. Using a plist file.
  2. Using a SQLite DB.
  3. Using Core Data.

You can probably start with a plist, which is the easiest thing to do, and if required, upgrade to a Core Data or SQLite in a future version, by including a hidden migration procedure when first running the new version of the app.

pgb
+1 to the whole post. Just writing out the array to a plist is quite sufficient for the time being, and moving to Core Data won't be hard if it ever becomes necessary (and it very well never may be necessary — that sort of complexity is usually inherent in the problem domain).
Chuck
+1  A: 

Look at the settings module

Straight tutorial from apple

Covers using the settings bundle to allow a user to change preferences or to just store them for yourself.

I personally like using Core Data and creating a table called properties with a key and value field.

Chris