1

My overall question is how to move an existing UIMangedDocument (with a core data sql store) from the local sandbox to the iCloud.

Everything I am reading online is telling me to use NSFileManager's setUbiquitous:itemAtURL:destinationURL:error:. When doing this though, I noticed that persistantStore gets copied up to the cloud which I believe is wrong. After thinking this throgh, I am starting to believe that I should create a new document in the cloud, and then manually insert the existing records (because an existing database in the sandbox does not have any transaction logs).

So, is my line of thinking correct, or is the persistantStore that is copied up there used as a starting point (so if another device is connected, it downloads the persistantStore as a base and then applies any new transactions that occured after that)?

A secondary related question (just to confirm my understanding of how UIManagedDocument works), if I were create a document (in the cloud), add a record and update the same record 100,000 times, and then open this document on a new device, would it have to apply the 100,001 transactions to a new database? Seems like a document that is being used heavily is going to continue to consume space on the cloud even if the document has minimal data but lots of updates.

Neysor
  • 3,893
  • 11
  • 34
  • 66
Robert Charest
  • 814
  • 7
  • 4

0 Answers0