views:

107

answers:

2

Hi there,

I'm working on an application that has a read-only database shipped with it.

The user will run the application and be able to select a series of "favourites" from the database which will appear in there "favourites" tab bar section. I.e. storing the primary keys.

With each update to the application the read only data will potentially contain more entries or have things like spelling mistakes fixed etc.

I'm using Core Data but I'm unsure whether to use it for storing the users "favourites" as-well. As - to my way of thinking - this might cause headaches for migration. Is this the case?

Should I consider storing the "favourites" in a plist perhaps and perform some sort of query to retrieve the records? Any recommendations?

Also what internal pieces of an iphone application are kept (or can be kept) during an update?

Phew I think that's it.

Thanks for any answers you might have.

Cheers, Matt

A: 

I'm using Core Data but I'm unsure whether to use it for storing the users "favourites" as-well. As - to my way of thinking - this might cause headaches for migration. Is this the case?

If you're going to port the app to another platform, then Core Data is not the way to go. And since we are talking about a static database, I'd keep it simple - read it once, do what you need with it and close it and forget about it. Not like a real database where you're doing multiple GETs and some amount of additions, modifications and deletions.

Should I consider storing the "favourites" in a plist perhaps and perform some sort of query to retrieve the records? Any recommendations?

Your database could be a plist too. After the user selects their favourites, you can easily store them in yet another plist. This one goes in the Documents or Prefs folder.

When you release a new app, you should probably compare the favourites with the new entries to correct any typos or other changes, if applicable.

Also what internal pieces of an iphone application are kept (or can be kept) during an update?

I believe that your app is replaced but your Documents and Preferences folders are kept intact.

mahboudz
A: 

Ok thanks for your help.

Suppose I follow the idea of what's being proposed in the following link:

overwrite-database-or-update-iphone

Ok, so assuming I've got two persistent stores one that's static application data and one that stores "dynamic" favourites data.

Does this mean I'll effectively need two xcdatamodel files? One for each store? Or can you specify where a class is stored somehow?

I've also read a small amount about "fetched properties" that according to the docs are used for cross store relationships.

Thanks for any help on this. The documentation is pretty lacking.

Matt

Sway