views:

48

answers:

1

I'm diving into iOS development and I have a quick noob question about Core Data. As I understand it, any data that in an app's Documents folder is backed up to iTunes when the user syncs their device. Does that mean if my core data sqlite db is in the Documents folder, then that data will be synced between multiple devices with the same iTunes account?

If so, how does it sync it with a device that already has the core data file in the Documents directory? Does it just overwrite it with the file on the last device that was synced?

Thanks for your help!

+4  A: 

Backups are completely managed by iTunes and stored per device, so they cannot be used to transfer information between the same app on different devices. More precisely, iTunes stores a single backup for each different iOS device you sync. So if you have an iPad and an iPhone, iTunes will have one backup for the iPad and one backup for the iPhone.

Moreover, the single backup is overwritten each time you sync the device. The only way data can get from a backup file to a device is if you use iTunes to restore the backup, which will overwrite any existing data on the device.

Unfortunately, backups are really only meant to be just that and are not helpful in terms of syncing between devices.

See this Apple support document for more details.

Tim Isganitis
Thank you for that very thorough response!
BeachRunnerJoe