I have an array as follow which comes from Sqlite DB & are in string:
(
{
id=1;
duedate = "01-Apr-2013";
},
{
id=2;
duedate = "01-May-2013";
},
{
id=3;
duedate = "01-Jun-2013";
},
{
id=4;
duedate = "11-Jul-2013";
}
)
My code for sorting the array
NSSortDescriptor *sortDesc = [[NSSortDescriptor alloc] initWithKey:@"duedate" ascending:YES];
[assessment_list sortUsingDescriptors:[NSArray arrayWithObject:sortDesc]];
But This give wrong sorted array as follow
(
{
id=1;
duedate = "01-Apr-2013";
},
{
id=3;
duedate = "01-Jun-2013";
},
{
id=2;
duedate = "01-May-2013";
},
{
id=4;
duedate = "11-Jul-2013";
}
)
I searched but i didn't found this issue