I am having a CoreData structure. It is working fine for me. Now I am trying to do an interesting FetchRequest, however I am struggeling to find the correct predicate.
I am having two ententies, Person and Venues. A person can be connected to many venues, but only once to the same venue. And other way around.
I have created a mapping table, which saves the person and venue as relationships. Everything is working fine here. I even implemented the inverse relationship.
In the picture left is my venue. I want to Fetch all persons based on a current venue, where there is NO Mapping created already.
My approach was to use pk_venue, which gives me a set of PersonVenueMapping. However, how can I only use the persons of that Set.
fetch.predicate = NSPredicate(format: "NOT (person IN %@)", venue!.pk_venue[HELP])
I came up with that Predicate. However, how can I access the persons of that set? I would need a array/ set of only the persons, that are connected to that current object.
Edit: Just to give you example.
Person: Max, Leon, Henry
Venue: Venue1, Venue2, Venue 3, Venue 4
PersonVenueMapping: Max <-> Venue1
Now when I select Max, I want Venue2 & Venue3 & Venue4
Thanks in advance
