I'm currently trying to create a core data model which consists of an array of a custom class/struct. I'm free to chooses either class or a struct for the model.
The Struct looks a little bit like this:
public struct takenImage{
var image: UIImage
var label: String
var time: NSDate
}
now I have my Core Data Model which has an entity called LogPhotos containing the attributes:
timestamp
of type Date
pictureArray
of type Transformable
Now I would like to have my pictureArray
contain an Array of the takenImage
struct. This is important because I need to call later for certain values from that struct. It's neccessary to get the image from that array for instance.
The issue is, that when I try to save the context it crashes with SIGABRT and uncaught exeption 'NSInvalidArgumentExeption' reason [myApp.takenImage:] unrecognized selector sent to instance
I guess it's because it cannot store the [takenImage]
to the transformable
.
What could I do? I'd like to avoid having another core data entity if possible. Thank you all in advance.