1

I have an array with values. How can I save this to Core Data in then easiest way? I know it has to do with ManagedObjectContexts and I already have Core Data added as a framework and set up the Entity. I tried following tutorial for this but I found it hard to generalize to my case.

Also, I have this:

var coordinates: [NSManagedObject] = []

but I want to save this:

var markersArray: Array<CLLocationCoordinate2D> = []

I believe that is not possible as that is not an NSManagedObject? How could I achieve that?

konyv12
  • 716
  • 2
  • 8
  • 23
  • Use NSArchive to convert array into bytes , than save that bytes in core data. You Just need to have one variable . But this will cause you a tough work if you want to edit that array again. – MOHAMMAD ISHAQ Apr 07 '17 at 11:11
  • Possible duplicate of [Saving an array with core data Swift 3?](http://stackoverflow.com/questions/42726611/saving-an-array-with-core-data-swift-3) – MathewS Apr 07 '17 at 13:16

0 Answers0