NSArray of Dates sort

前端 未结 2 946
遇见更好的自我
遇见更好的自我 2021-01-21 05:52

Consider this array. It has no keys, so I am not sure I can use NSSortDescriptor. What would be the best method to sort them?

(
    \"Thursday, July 30, 2009\"         


        
2条回答
  •  Happy的楠姐
    2021-01-21 06:42

    NSArray * unsortedDates = ...;
    NSArray * sortedDates = [unsortedDates sortedArrayUsingSelector:@selector(compare:)];
    

提交回复
热议问题