Best way to sort a dictionary by value?
Best way to sort a dictionary by value?
- Subject: Best way to sort a dictionary by value?
- From: Keith Pritchard <email@hidden>
- Date: Sun, 22 Sep 2002 20:46:45 +0100
Hi all,
Thanks to all the previous help I'm having fun developing my cocoa
app.. thanks all!
I'm at the stage where I have a dictionary of dictionaries that look
something like this:-
Dictionary 1
Key Value
123 Dictionary 2
Key Value
name David (string)
subject My Post1 (string)
date 19/02/02 (string)
124 .......
I'd like to sort the dictionary1 keys by the values in dictionary 2....
eg. I'd like to get an array of dictionary1 keys that when iterated
through would result in a table of dictionary2 values sorted by, say,
date
Before I do something silly like trying to loop through dict2 using a
standard sort algorithm, does cocoa give me anything to make it easier?
I keep looking at keysSortedByValueUsingSelector but not exactly sure
how it would work...
Thanks in advance,
Keith
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.