You should be able to do this using two descriptors, as you first said, first by reward and then by name. However, you need to provide a custom NSSortDescriptor for the assigned assigned class, which looks something like this:
This will allow you to split the sets: Awesome / Better / Cool and Another / Another One / One More / Another, in your example. After that, you should be fine:
NSSortDescriptor *sortDescriptor1 = [[AwardedOnSortDescriptor alloc] initWithKey:@"awardedOn" ascending:YES]; NSSortDescriptor *sortDescriptor2 = [[NSSortDescriptor alloc] initWithKey:@"title" ascending:YES];
In conclusion, you may need additional work depending on how your “empty” assignable fields look (I assumed in the code above that the field was set to zero). You can look here: fooobar.com/questions/1418687 / ...
source share