Re: Core Data sync between iOS and Mac apps
Re: Core Data sync between iOS and Mac apps
- Subject: Re: Core Data sync between iOS and Mac apps
- From: Jens Alfke <email@hidden>
- Date: Tue, 12 May 2015 08:35:09 -0700
> On May 12, 2015, at 6:00 AM, email@hidden wrote:
>
> I’m not sure I understand your concerns about Dropbox. The app is single user so when the iOS enters the background, I can upload the data (if there’s a network connection at the moment) for modified files to Dropbox.
A single-user app is less likely to encounter conflicts, but it can still happen since many users have multiple iOS devices. I frequently end up switching from iPhone to iPad, sometimes even the same app (quickly check news on my iPhone, start reading an article, go upstairs and grab the iPad so I can read the article more comfortably…) And if your app doesn’t somehow deal with this, it’s looking at potential data-loss scenarios.
You can still handle conflicts using Dropbox, it’s just trickier. You’ll need to detect the renamed version of the file that Dropbox creates — something like “MyAppData (Jens Alfke's conflicted copy 2015-05-09).db” — then open both files and reconcile any changes, then save back to the original file and delete the conflicted copy. And somehow keep both devices from doing this at the same time, or you’re back at square one.
—Jens
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden