I'm working on migrating my app from using CoreData to SwiftData. The swift data code generated by Xcode works correctly for the iOS and Mac Catalyst targets but it is causing a crash for the WatchOS target.
It gives me this message **Fatal error: Application must register a ValueTransformer for NSSecureUnarchiveFromDataTransformer **
This attribute is the only one with a .transformable
option.
@Attribute(.transformable(by: "NSSecureUnarchiveFromDataTransformer"))
public var linkedEntities: [UUID] = []
Changing the string NSSecureUnarchiveFromDataTransformer
to NSValueTransformerName.secureUnarchiveFromDataTransformerName.rawValue
causes a generic crash with no error message.
The app has CloudKit integration as well (not sure if relevant).
Does anyone have a similar issue and can help me on what to do here?