Sorting NSMutableArray using SortDescriptor AND Predicate possible?
问题 I have an array of type "Restaurant" which has an NSSet of "Rating." Rating has an ID and a value. I want to sort the array of Restaurant's by rating with an ID of 01, from high to low. Something like the following, but how do I use the predicate and sort descriptor together on originalArray? NSPredicate *predicate = [NSPredicate predicateWithFormat:@"Rating.rating_id=%d", ratingID]; NSSortDescriptor *descriptor = [NSSortDescriptor sortDescriptorWithKey:@"currentValue" ascending:YES]; NSArray