Wednesday 11 September 2013

Avoiding iCloud conflicts with non CoreData app

Avoiding iCloud conflicts with non CoreData app

I am working on a non CoreData based app (sqlite), now that it must be
ported to iPad, all hell has broken loose.
Since syncing is not needed, I am trying to stay with my good old sqlite
solution. However I have noticed that even now I have an ugly problem: if
the same app is used by the same user in different devices. The database
file is automatically backed up to iCloud, but now more than one device
want to upload different databases into the same location.
Which one is the common solution to this problem? My immediate guess is
saving the database into a subfolder like .../Documents/some_type_of_id/
and use iCloud to backup different databases and settings for each device.
How should I generate that ID? My first choice seems to be this:
[[[UIDevice currentDevice] identifierForVendor] UUIDString]
However, now that I am getting my hands dirty, I am wondering which
equivalent solution should be used with a Mac app (same iCloud user on
different macs). UIDevice is not within the Mac SDK.
How should I generate a Mac unique ID?
Although I am asking now about UIDs, my first concern is still avoiding
iCloud conflicts. I would appreciate any guidance or references to how
properly handle this case.

No comments:

Post a Comment