I am trying to sort an array in descending order,I can sort array in ascending order,Here is my code to sort in ascending order,
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"year" ascending:NO];
NSArray * descriptors = [NSArray arrayWithObjects:sortDescriptor, nil];
sortedArray = [array sortedArrayUsingDescriptors:descriptors];
dictionaryWithSortedYears = [[NSMutableDictionary alloc] init];
NSString *tempDateKey = nil;
for (TreeXmlDetails *list in sortedArray)
{
    id obj = [dictionaryWithSortedYears objectForKey:list.year];
    if(!obj)
    {
        if(tempDateKey == nil)
        {
            arrayFromList = [[NSMutableArray alloc] init];
            tempDateKey = list.year;
        }
    }
    if([list.year isEqualToString:tempDateKey])
        [arrayFromList addObject:list];
    else
    {
        [dictionaryWithSortedYears setObject:arrayFromList forKey:tempDateKey];
        tempDateKey = nil;
        arrayFromList = nil;
        arrayFromList = [[NSMutableArray alloc] init];
        tempDateKey = list.year;
        [arrayFromList addObject:list];
    }
}
[dictionaryWithSortedYears setObject:arrayFromList forKey:tempDateKey];
NSArray *arr = [dictionaryWithSortedYears allKeys];
sortedKeys = [[NSArray alloc] initWithArray:[arr sortedArrayUsingSelector:@selector(compare:)]];
But, I want to sort an array in descending array,Please help me. Thanks in advnace.
 
     
    