I do have a simple Integer Array
that I want to save/load to CoreData
.
Do you have example of the best way to do both of the methods ?
Thank you!
I do have a simple Integer Array
that I want to save/load to CoreData
.
Do you have example of the best way to do both of the methods ?
Thank you!
Create an attribute with type binaryData in your entity. And convert your array to data using
NSKeyedArchiver.archivedDataWithRootObject(AnyObject)
And convert the array from data using
NSKeyedUnarchiver.unarchiveObjectWithData(NSData)
By this way you can store any object in core data.