NSMutableDictionary of NSMutableSets... sorting this out
- by Mike
I have a NSMutableDictionary of NSMutableSets.
Each set entry is a string, something like this:
NSMutableSet *mySet = [NSMutableSet setWithObjects:
[NSString stringWithFormat:@"%d", time1],
[NSString stringWithFormat:@"%d", time2],
[NSString stringWithFormat:@"%d", time3],
nil];
// time 1,2,3, are NSTimeInterval variables
then I store each set on the dictionary using this:
NSString *rightNowString = [NSString stringWithFormat:@"%d", rightNow];
[myDict setValue:mySet forKey:rightNow];
// rightNow is NSTimeInterval
as rightNow key can occur out of order, I end with a NSDictionary that is not ordered by rightNow.
How can I sort this NSDictionary by its keys considering that they are numbers stored as strings on the dictionary...?
I don't care for ordering the sets, just the dictionary.
thanks for any help.