I am trying to store custom class type array in coredata.
What I've got setup is an Entity called Node with properties value of type string and children of type Transformable. The children property is supposed to store an array of type Node as in the code below.
public class Node: NSManagedObject {
@nonobjc public class func fetchRequest() -> NSFetchRequest<Node> {
return NSFetchRequest<Node>(entityName: "Person")
}
@NSManaged public var children: [Node]?
@NSManaged public var value: String?
}
.xcdatamodel setup:
Currently the app crashes with error message "This decoder will only decode classes that adopt NSSecureCoding. Class 'Node' does not adopt it." So I tried it with String array instead of Node array and it seems to work.
I'm guessing something extra needs to be done to store Custom array type.
