I have a dictionary like:
{
"2014-04-12" = (
{
"can_remove" = 1;
"date_created" = "12-04-2014 04:23:57";
"is_connected" = 0;
name = "J J";
status = gbn;
"user_id" = 94;
}
);
"2014-04-14" = (
{
"can_remove" = 0;
"date_created" = "14-04-2014 02:36:52";
"is_connected" = 0;
name = abc;
"user_id" = 89;
}
);
}
The keys of this dictionary represent dates. How can I sort this by date?
I tried this, but it doesn't work:
NSArray* keys = [dict allKeys];
NSArray* sortedArray = [keys sortedArrayUsingComparator:^(id a, id b) {
return [a compare:b options:NSNumericSearch];
}];