After installing iOS 18.1 and iPados 18.1 we get a consuste failure when trying to add to our one to many data model. This was working well until we installed 18.1
when trying to add a entry to the many relationship we get this error
Illegal attempt to map a relationship containing temporary objects to its identifiers.
The solution to this was that prior to iOS 18 if you had a one to many relationship in your SwiftData models that adding to the array in the "one" data model entity would automatically update the "many" data item so that its optional attribute that pointed back to the data item containing the array of "many" items when you added items to the array.
In iOS 18 now this is no longer true and if you don't set that optional attribute to explicitly point to the data model that will contain the array of "many" items then you will see the aforementioned error when you try to append the new item to that array. Hopefully this makes sense and will help someone down the road.