NSSortDescriptor *sd1 = [NSSortDescriptor sortDescriptorWithKey:@"current_buy" ascending:YES];
//yes升序排列,no,降序排列
NSArray *myArray = [self.articleArr sortedArrayUsingDescriptors:[NSArray arrayWithObjects:sd1, nil]];
self.articleArr = [myArray mutableCopy];
[self.collectionView reloadSections:[NSIndexSet indexSetWithIndex:2]];
// 1.先按照书名进行排序
// 这里的key写的是@property的名称
NSSortDescriptor *bookNameDesc = [NSSortDescriptor sortDescriptorWithKey:@"book.name" ascending:YES];
// 2.再按照姓进行排序
NSSortDescriptor *lastnameDesc = [NSSortDescriptor sortDescriptorWithKey:@"lastname" ascending:YES];
// 3.再按照名进行排序
NSSortDescriptor *firstnameDesc = [NSSortDescriptor sortDescriptorWithKey:@"firstname" ascending:YES];
// 按顺序添加排序描述器
NSArray *descs = [NSArray arrayWithObjects:bookNameDesc, lastnameDesc, firstnameDesc, nil nil];
NSArray *array2 = [array sortedArrayUsingDescriptors:descs];