I have a simple reader app on the app store that I am trying to add some functionality to. Right now the users of the app have the ability to store different bookmarks, take notes, and highlight different parts of the content, and this is all saved to a local sqlite db in the documents directory using FMDB.
Everything works great except for every time the app is deleted, there goes the local db. So with the advent of iCloud, I'm wondering if there is an ideal solution for somehow making backups of my db, and restoring it when needed? Also, what about syncing it between use on different devices?
If not iCloud, what are my other options to implement this feature? I've seen it in a few different apps, I just don't know how they do it.
Thanks!
Happy Thanksgiving!
iCloud is a very good solution. You will have to serialize the data and upload it; then download it and compare with what is in the db, then ignore, delete or replace.
Check out the new iCloud APIs - they are quite straight forward!
In the section Defining a Structured Data Model Using Core Data
it says:
It allows you to store your data in iCloud and access it from multiple devices.
In Using iCloud in Conjunction with Databases
there is a very good explanation. Basically, you just exchange change logs rather than transferring the database files.