I have a fetched results controller that should display all items of a certain entity that has a number of subentities.
The sections in the fetched results controller should be based on the entity name, i.e which subentity an item belongs to. Setting the sectionNameKeyPath
to @"entity.name"
works.
It seems, however, to be impossible to get the right sort descriptor for the fetch request. Things like [NSSortDescriptor sortDescriptorWithKey:@"entity.name" ascending:YES]
result in errors like keypath entity.name not found in entity Something
.
Try using [NSSortDescriptor sortDescriptorWithKey:@"name" ascending:YES];
You don't need the preceding entitiy, since the entitiy ist already defined by the fetch request. See also the Sort Descriptor Class Reference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With