I have found a solution, at least one that works for my project. I hope it can help others here!
The issue wasn't in the code I had to delete the record from the model context. The problem was an improper use of Binding.
A parent view was presenting a list of child views. Into that child view I was passing a "Recording". Within the child that Recording was an at Binding. That was totally unnecessary and I think causes a conflict with the model context being used by the child(?). So it was being passed in as a constant like this:
List {
ForEach(filteredRecordings) { recording in
RecordingItemView(
recording: .constant(recording),
Removing the Binding and changing a regular property fixed my iOS18 crash:
List {
ForEach(filteredRecordings) { recording in
RecordingItemView(
recording: recording,
The UI of my parent view is already being updated via changes to the modelContext... so the Binding is just a total mistake.
Good luck!
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags: