Sort NSArray custom object on multiple properties
问题 I have a custom object with multiple properties. One property is a Type, for example an enum: A, B, C etc These all have a Date too. @property (assign) CustomType customType; @property (nonatomic, strong) NSDate *startDate; ... typedef NS_ENUM(NSInteger, CustomType) { A, B, C }; I would like to put all objects of type 'C' first then order the rest by their Date DESC. What is the best way to achieve this? I've tried adding multiple sortDescriptors but I only want C objects at the top, then the