I am in a similar situation.
I want to use a NSFetchedResultsController to manage B's in the one to many (A-->>B) relationship. Now, one way of doing this is to build a predicate like the one below and apply it to entity B:
NSPredicate *Predicate = [NSPredicate predicateWithFormat:
@"ANY hasParent.label == 'A'"];
But this is a terribly slow way of doing things and should be avoided at all costs.
I tried this on 25,000 objects to retrieve about 300 and it took the simulator about 15 seconds. It wouldn't finish the fetch on the iPhone and crashed repeatedly.
The other way would be to do what has already been mentioned, create an NSArray from the set held by A and sort it. If you send allObjects to a set you get an array back. A is an NSManagedObject fetched before.
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc]
initWithKey:@"Name"
ascending:YES];
NSArray *lotsOfB = [[[A hasRelationsTo]
allObjects]
sortedArrayUsingDescriptors: sortDescriptors];
This is very fast. No lag in the simulator or on the device. But you cannot use a NSFetchedResultsController sad times :-(
Hope that helps.