0

I have an app, which creates a managed document on start, and imports some default data. then user can add his own data. all data handled by a single document. Now i want to add icloud support. and im wondering what should i do, if there is a document in icloud already from 1st device, and user laucnhes the app on the 2nd device for the first time, but it has no connection to the internet. So basicly i cant check if there is a file on icloud, and if i create a new managed document with a default base it wont be able to synchrinize with the file that is already in icloud (not sure about that though). What is the best way to resolve this situation?

t0a0
  • 668
  • 1
  • 9
  • 18
  • Its fine to do that but when the device does connect to the network then your app needs to handle any issues that may arise when importing the transaction logs from iCloud, noting that its going to happen in both directions. Usually this will require some logic for reduplicating things and if necessary establishing correct relationships between merged objects. This is non-trivial for anything but the simplest data models – Duncan Groenewald Nov 27 '13 at 20:45
  • well the thing is, when i run the app for the first time on second device, it debugs that there is such file in icloud, but it is not available now, and if user starts to import his data, later when icloud is available and that document starts to update itself from icloud, user imported data(while icloud wasnot available) gets deleted. But if the document is downloaded already, everything will be fine even if icloud is unavailable(it will just upload the data later). – t0a0 Nov 28 '13 at 15:12
  • I can't say I've seen that behaviour yet. It seems odd that it is able to detect the file exists in iCloud but that its not available now, perhaps the logs never downloaded from the originating device or something. – Duncan Groenewald Nov 28 '13 at 18:52
  • i mean iCloud is not available now, not the file :)(well if iCloud is Unavailable then file is unavailable too) – t0a0 Nov 29 '13 at 13:35
  • OK well I don't know if I understand what this sentence of yours means or what the specific problem is you want to solve `when i run the app for the first time on second device, it debugs that there is such file in icloud, but it is not available now`. – Duncan Groenewald Nov 29 '13 at 19:59
  • i already got this, should've spend more time understanding the documentation. Thanks for help though. – t0a0 Nov 30 '13 at 22:42

0 Answers0