Core Data - How to delete ONLY the relationship link between 2 entities

This is driving me nuts and I can't find anything where someone else has asked the same question. It can't be an unusual situation.

I have a Student entity and a Classes entity and both are bi-directional

Student<<-->>Classes

A Student can be assigned to many Classes and Classes can have many students When a Student drops out of a given class, I want to remove the link between the particular student and the class - but without deleting either the student or the class objects.

All my attempts have deleted either the student or the class object. How do I remove the relationship without removing the objects ?

Is it possible ? In the interim I guess I can create a new entity... a 2 field table that links student and class... 1 to 1... then just delete the individual records to break a link... sounds like a lot of extra overhead though for what's supposed to be relational

Thank You to Joakim Danielson on StackOverflow ! The answer was there... I just wasn't aware... Core Data creates a func for the entity relationship.

As an example, entity Students has a relationship named Classes (destination = Classes entity) entity Classes has a relationship named Students (destination = Students entity) Core Data creates a func for each of the entity relationships: .removeFromClasses() .removeFromStudents() these remove the relationship link from each of the respective relationships. In order to remove the relationship completely, I execute both func - the entity objects both remain but are no longer linked !

Core Data - How to delete ONLY the relationship link between 2 entities
 
 
Q