数组的属性排序

 //按照下单日期排序

                if (self.orderListArrM.count > 0) {

                    //createDate是数字mode中的属性

                    NSSortDescriptor* createDateDesc = [NSSortDescriptor sortDescriptorWithKey:@"createDate" ascending:NO];

                    //重新

                    self.orderListArrM = [[NSMutableArray alloc] initWithArray:[self.orderListArrM sortedArrayUsingDescriptors:@[createDateDesc]]];

                }

原文地址:https://www.cnblogs.com/iOS771722918/p/4346801.html