0
阵列
我的应用程序有3种对象:A,B和C中的每个对象由字典表示这样的:iphone - 排序字典
NSDictionary *oneObject = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:i], @"number",
[NSString stringWithString:@"A", @"kind", //this can be A, B or C
[NSNumber numberWithBool:YES], @"used", // YES or NO
[NSString stringWithString:oneName, @"name",
nil];
对象像存储像阵列上这个:
NSMutableArray *listOfObjects = [NSMutableArray arrayWithObjects:
oneObject1, oneObject2 ..etc.. , nil];
所以,我有一个可变的字典数组。
现在我想这个排序可变数组,获得一个新的数组以下列顺序
1) all objects A
2) all objects B
3) all objects C
所有对象都在他们的类别进行分类...像
object A, apple
object A, banana
object A, orange
object B, car
object B, donkey
object B, phone
object B, zebra
object C, ant
object C, box
object C, cigar
object C, hotel
object C, lamb
我的意思是,每个类别都按对象名称排序,但整个数组按类别排序。
我该怎么做? 感谢您的任何帮助。