core-databetaswiftdataxcode15

CoreData error message when using SwiftData in Xcode 15 beta 5


I am using SwiftData in my project. All worked fine under Xcode 15 beta 4 in the simulator. Since I changed to Xcode 15 beta 5 I am getting the following error multiple times:

CoreData: fault: One or more models in this application are using transformable properties with transformer names that are either unset, or set to NSKeyedUnarchiveFromDataTransformerName. Please switch to using "NSSecureUnarchiveFromData" or a subclass of NSSecureUnarchiveFromDataTransformer instead. At some point, Core Data will default to using "NSSecureUnarchiveFromData" when nil is specified, and transformable properties containing classes that do not support NSSecureCoding will become unreadable. 'NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release

I understand this is an error in the underlying CoreData setup. However, how can I change the CoreData config? If you use CoreData directly you can change the config, but how do you do this, when you use SwiftData. And why does Apple not use the proper config from the start?

I am using standard code that defines my model:

@Model final class LoggerItem {
    @Attribute(.unique) let id: UUID
    var title: String
    var created: Date
    var modified: Date?
    ...
}

This already creates above error messages.


Solution

  • Apparently this has been fixed in Xcode 15 beta 7