0

난의 startDate를 기준으로 정렬 할 필요가 사전sortUsingDescriptors를 사용하여 날짜 문자열 정렬?

points = 200; 
    startDate = "Jun 04, 2011, 13:15 PM"; 

    points = 200; 
    startDate = "May 01, 2011, 11:15 PM"; 

    and ------- 

의 배열 수 있습니다.

나는이 방법을 통해 이전의 수치 .. 알파벳 정렬 등 등의 분류 번호 사용했다 :

-(NSMutableArray*)SortEventsArray:(NSMutableArray*)arrayToSort :(NSString*)sortExpression 
{ 
    NSSortDescriptor *mySorter = [[NSSortDescriptor alloc] initWithKey:sortExpression ascending:YES]; 
    [arrayToSort sortUsingDescriptors:[NSMutableArray arrayWithObject:mySorter]]; 
    return arrayToSort; 
} 

을하지만 날짜 문자열을 작동하지 않습니다.

답변