SwiftData error when trying to save array in Model

In my SwiftData @Model I have an attribute attachments: [String]? and I'm getting an error when trying to save it:

CoreData: fault: Could not materialize Objective-C class named "Array" from declared attribute value type "Array<String>" of attribute named attachments.

Getting this error periodically on iOS 18 Beta 7 on iPhone, but the same code works on iPadOS 18 b7 and on macOS Sonoma (14.6.1)

Anyone seen this?

Could you show more code ?

I'm easter egging here. Could it be something like the objective c array is a reference type and the [String] is a value type?

Sorry, was away for a week and now it seems to be working correctly in Beta 8.

Still having issue in release :(

I've been building something with SwiftData that has been working perfectly fine, then suddenly the last couple of release versions (of Xcode) I get this error every time I try to create a SwiftData object. It doesn't like a set of strings I have, but I get the same error if I change the set to an array. Really frustrating and confusing.

SwiftData error when trying to save array in Model
 
 
Q