I am making a game in Swift with SpriteKit, it happens that it does not give me the option to save the data with Core Data.
I am doing it by saving the data in a file, but since there is a lot of data, my arrangement is like this: [String : [[String:Any]] ]
and it throws me the error:
Cast from 'NSArray?' to unrelated type '[String : [[String:Any]] ]' always fails
Even if I narrow down the array to something like this: [[String:Any]]
it throws me the same error.
Therefore I want to see if I can save the data in CoreData (although I have never used it, I only saw a tutorial) and if so, someone can guide me to see how to do it.
Thank you
You have to keep in mind that using
CoreData
together withSpriteKit
does not entail any problem since they areframeworks
completely different from. To reduce the learning curve and to implement it quickly and easily, I recommend that you use MagicalRecord . The documentation is simple and with many examples.Failing that, and if you want to learn a new type of
storage
much faster and more modern thanCoreData
you can also use Realm.io which is also cross-platform.