As an example, in my Core Data model, I have created an entity called Question.
So I have the following 'Question+CoreDataproperties.swift' file. One of the attributes is mediaFiles, stored as a [String].
import Foundation
import CoreData
extension Question {
...
@NSManaged public var mediaFiles: [String]
}
I have set this attribute as a transformable. Then, in the inspector of the mediaFile attribute, under the 'Custom Class' field, I set [String] as well.
I am able to save the attribute after adding some info with no errors. However, when closing and re-entering the app, the information is lost. All other non-transformable attribites (String, Int32, etc) managed to be saved persistently. So the transformable attribute is somehow not storing persistently?
I have read a few other forums showing the use of 'Class NSObject, NScoder' for such transformable data to store them persistently.
However, this is only useful when the 'Custom Class' field in the inspector is set to the default NSObject? Any other ideas on how to go around this problem?