Sorting an NSArray by an NSDictionary value
问题 I'm trying to sort an array that would look something like this: (please ignore the fact these people are well past any living age! I just needed large numbers) NSDictionary *person1 = [NSDictionary dictionaryWithObjectsAndKeys:@"sam",@"name",@"28.00",@"age",nil]; NSDictionary *person2 = [NSDictionary dictionaryWithObjectsAndKeys:@"cody",@"name",@"100.00",@"age",nil]; NSDictionary *person3 = [NSDictionary dictionaryWithObjectsAndKeys:@"marvin",@"name",@"299.00",@"age",nil]; NSDictionary