Hi, I'm making this post partly as a bug report, and partly to help others that run into what I just did using SwiftData (and probably happens in CoreData). I have a model I just added in my app that looks kinda like this: @Model final class Reference { // represents a reference to an external web source var project: Project } and I tried adding a relationship to a parent model: @Model final class Project { @Relationship(deleteRule: .cascade, inverse: Reference.project) var references = [Reference]() } I then started getting a crash with EXC_BAD_ACCESS(code=2 on Previews, and running it in simulator/device revealed the crash to be happening on the ModelContainer initialization at the App startup: After hours of searching for a solution, I saw some mention of similar unexplained crashes occurring due to some property names that CoreData doesn't like, but are not documented as such. So I changed the references variable in Project to projectReferences on a hunch (references is a core programmin
1
0
1.1k