0

I have an app working with NSCoding, 3 classes, unrelated - hence went with the simple NSCoding approach to save my array of objects.

However, now the question of iCloud. From what I understand Core Data now works with iCloud basically out of the box. Very easy to implement.

To help you persist managed objects to the cloud, iCloud is integrated with Core Data. To use Core Data with iCloud, you simply tell Core Data to create an iCloud-enabled persistent store. The iCloud service and Core Data take care of the rest

So, the question is should I convert my app to use Core Data, which gives me iCloud basically default - or is it just as easy to set up iCloud it my current set up with NSCoding

Developing in Swift for iOS 9

Thanks

DogCoffee
  • 19,820
  • 10
  • 87
  • 120
  • "From what I understand Core Data now works with iCloud basically out of the box." - definitely not. Quite complicated by the time you take into account upgrades, users turning iCloud on or off, data integrity requirements, backups, recovery, etc... – Duncan Groenewald Oct 14 '15 at 08:57
  • There must be a better way.... I tried Parse and local store. But that ended up being a nightmare as well. Maybe cloudKit .... – DogCoffee Oct 14 '15 at 09:21
  • You don't need Core Data to use iCloud-- you can save files in iCloud without using Core Data. – Tom Harrington Oct 14 '15 at 19:23
  • @TomHarrington I understand that, I was just wondering if it makes things easier that way. – DogCoffee Oct 14 '15 at 22:03
  • No, that would make things more difficult. Unless you need Core Data for something other than iCloud, don't add it just to get iCloud support. – Tom Harrington Oct 15 '15 at 00:06
  • Cheers Tom, checking out UIDocument now – DogCoffee Oct 15 '15 at 01:02

1 Answers1

2

iCloud support may work well with CoreData by now. However, it was so broken for so long that I (and others) completely stopped using it. I wasted so much time trying to get it to work, that I refuse to spend one more second trying to ever use it again.

After writing my own proprietary CoreData syncing solution, I finally tried Ensembles and I've never looked back.

However, if your application does not currently require CoreData, why not use the standard iCloud support? It seems to work fine for normal file syncing, which is what you seem to have if you are just saving objects to file.

No need to add the complexities of CoreData if your app is working just fine without it.

Jody Hagins
  • 27,943
  • 6
  • 58
  • 87
  • I had the same issue - I gave up on iCloud 2 years ago - wishful thinking that it would just work. I assumed that it would be too network intensive this way, saving out my entire object graph each time something changed in just one object. – DogCoffee Oct 14 '15 at 22:07
  • If you want to sync with Core Data, I am a firm believer in Ensembles. I have no relationship with them, except as a paying customer for version 2. Version 1 is still freely available as open source, and works just fine. – Jody Hagins Oct 15 '15 at 00:26
  • Will check it out Jody. Thanks – DogCoffee Oct 15 '15 at 01:01
  • I got bulk sync working with UIDocument and ICloud.. then the issues started i.e. race conditions. I checked out Ensembles and watched the intro video. If i was going to use it id your Version 2 and pay for it. Oddly there isn't any new videos or tutorials online about this service. How does it play with Swift ?? – DogCoffee Oct 15 '15 at 21:31
  • I've yet to have a reason to move to Swift, so I don't know. I may be an odd cow, but I **really** like ObjectiveC. However, I assume it plays just as well as all the other ObjectiveC APIs do with Swift, and should pose no issues. Feel free to ask the developer. He has been super responsive to any issues or questions, even before I gave him my money. – Jody Hagins Oct 15 '15 at 22:10
  • I downloaded the book and it mentions it plays well will Swift. I was the same... but once I got into Swift looking at Obj C code hurts my brain. I have no doubt you'll feel the same. Thanks again. – DogCoffee Oct 15 '15 at 22:14
  • Need some help Jody http://stackoverflow.com/questions/33204120/swift-ensembles-set-up-ubiquitycontaineridentifier – DogCoffee Oct 19 '15 at 01:27