Post

Replies

Boosts

Views

Activity

Reply to iOS 18 SwiftData ModelContext reset
I'm running into the same problem in my app. The proposed solution of using a @State variable isn't easily possible for me, as while I am using SwiftUI for the front-end of the app, I've isolated the SwiftData utility into an external package. I'm getting a crash only in the iOS 18 betas, on device and in the simulator. This model instance was destroyed by calling ModelContext.reset and is no longer usable. PersistentIdentifier(id: SwiftData.PersistentIdentifier.ID(url: x-coredata://F5001085-8312-4E76-9730-25A81E049FB0/SentPostcard/p1), implementation: SwiftData.PersistentIdentifierImplementation)
Jul ’24