'Illegal attempt to establish a relationship 'events' between objects in different contexts"
Is the clue here.
let selectedEvents = events.filter({ $0.isSelected }) let note = Note(newNoteContent, events: selectedEvents)
You need to fetch the "events" data using the same context that you are using to insert the Note
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: