我有一个带有数据的 NSMutableArray:
Name ... Male ... Age ... Point
("David"..."Male"...18...7.25)
("Mary"..."Female"...16...20.50)
("Kend"..."Male"...17...4.50)
("Frank"..."Male"...25...27.50)
("Cain"..."Female"...28...2.25)
("Sims"..."Female"...17...10.50)
...
我想按关键点对这个 NSMutableArray 进行排序。我试过了:
NSSortDescriptor *aSortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"Point" ascending:NO];
[self.arrayPupils sortUsingDescriptors:[NSArray arrayWithObject:aSortDescriptor]];
和输出:
David/Male/18/7.25
Kend/Male/17/4.50
Frank/Male/25/27.50
Mary/Female/16/20.50
Cain/Female/28/2.25
Sims/Female/17/10.50
但预期的结果是:
Frank/Male/25/27.50
Mary/Female/16/20.50
Sims/Female/17/10.50
David/Male/18/7.25
Kend/Male/17/4.50
Cain/Female/28/2.25
请帮助我...非常感谢。