Post

Replies

Boosts

Views

Activity

Reply to Fatal error: Duplicate keys of type 'AnyHashable' were found in a Dictionary
I found the solution was to add var id = UUID() to the model definition so the final result would look something like: @Model final class Character { var id = UUID() var name: String var production: Production? var myCharacter: Bool init(name: String, production: Production?, myCharacter: Bool = false) { self.name = name self.production = production self.myCharacter = myCharacter } } @Model final class Production { var id = UUID() var name: String @Relationship(deleteRule: .cascade, inverse: \Act.production) var acts: [Act] = [] init(name: String) { self.name = name } }
Jan ’25