Crash when setting up relationship between model objects
Number:rdar://FB13444643 Date Originated:2023-12-04
Status:Closed Resolved:iOS 18
Product:SwiftData Product Version:iOS 17.2 Seed 3 (21C5046c)
Classification:Incorrect/Unexpected Behavior Reproducible:Always
I have attached a sample project that demonstrates a straightforward use case of SwiftData: creating a tree of model objects and then inserting the whole tree into the model context using a single `ModelContext.insert` call. The app crashes while setting up a relationship. The stack trace is attached.



Not reproducible on iOS 18.

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!