Given the following core data model:
EntityA <--->> EntityB <--->> EntityC
I already have fetched the required EntityA
in a first TableViewController
. When selecting a row, the user goes to a second ViewController, following the relationship. This second view has a @property EntityB *entityB
. In this second view, there are controls that will modify attributes of EntityC
. So if EntityB
has 4 EntityC
, there will be 4 sliders. Each slider modify an attribute of one of the EntityC
.
My question is: what's the best way to select the right EntityC? The following predicate
NSEntityDescription *entity = [NSEntityDescription entityForName:@"EntityC" inManagedObjectContext:self.managedObjectContext];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"entityB == %@ AND rank == <#some number#>", self.entityB];
returns the correct value. But isn't this overkill when selecting 1 out of 4 entities?