我有如下数组,它来自sqlite的DB &是字符串:排序的具体日期,阵列
(
{
id=1;
duedate = "01-Apr-2013";
},
{
id=2;
duedate = "01-May-2013";
},
{
id=3;
duedate = "01-Jun-2013";
},
{
id=4;
duedate = "11-Jul-2013";
}
)
我排序的阵列码
NSSortDescriptor *sortDesc = [[NSSortDescriptor alloc] initWithKey:@"duedate" ascending:YES];
[assessment_list sortUsingDescriptors:[NSArray arrayWithObject:sortDesc]];
但这给出错误的排序阵列如下
(
{
id=1;
duedate = "01-Apr-2013";
},
{
id=3;
duedate = "01-Jun-2013";
},
{
id=2;
duedate = "01-May-2013";
},
{
id=4;
duedate = "11-Jul-2013";
}
)
我搜索,但我没有发现这个问题
我应该在的地方string1'&'字符串2的'写'?我的阵列数是4. – user1673099 2013-03-25 09:34:37
现在检查,我已编辑,以适应您的答案 – DivineDesert 2013-03-25 09:36:02
返回[日期2比较:日期1]得到它降序 – DivineDesert 2013-03-25 09:48:00