Search code examples
iosdatabaseauto-update

Automatically update iPhone app database without making user do anything


I have a pretty strong background in C++ and am making the switch to Objective-C to try to make an iPhone app. A main component of my app will be a database.

1) Is there a way to update the database of the app without requiring users to update to a new version from the App Store?

2) If there is, where & how do you pull the data into your app? Do you have to pull it from a website?

2a) Is there a way to make a master copy of the app that I can make data changes in and then have that copy update all other versions of the app?


If my database contains info that is only updated by me, do I need to store each piece of data as an object?

Ex: One "object" may have a name, a type, a number, and a picture

names, and types will overlap but numbers and pictures will be unique

Thanks again.


Solution

    1. Yes, copy the datdabase (SQLite) from the application bundle to the documents folder. For an update, download over top the old one. Also, you can use something simpler than a database like an NSDictionary stored in a .plist file.
    2. Yes, from a web server. NSDictionary has methods that let you download directly from a URL (dictionaryWithContentsOfURL). So does NSData.
    3. Why not use third party tools to edit data? You can store a NSDictionary in a .plist file and edit it there, then upload it to the web server.