我有如下數組,它來自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