Try the following code if the dict contains NSString in date format:
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"your date format"];
NSArray *sortedKeys = [yourDictionary keysSortedByValueUsingComparator:^NSComparisonResult(NSString *obj1, NSString *obj2)
{
NSDate *date1 = [dateFormatter dateFromString:obj1];
NSDate *date2 = [dateFormatter dateFromString:obj2];
return [date1 compare:date2];
}];
The sortedKeys will contain the sorted names.
If the dictionary contains actual NSDate objects then:
NSArray *sortedKeys = [yourDictionary keysSortedByValueUsingComparator:^NSComparisonResult(NSDate *obj1, NSDate *obj2)
{
return [obj1 compare:obj2];
}];