Hi guy's
I am having an string array which contains the date values as : 2010-09-18,2010-09-23,2010-09-27. I need to sort them in descending order,can anyone please help me to do this.
like 2010-09-27,2010-09-23,2010-09-18.
Actually what I am doing was:
-(void) organizeAisleItemsIntoIndexes
{
printf("\n Inside organizeAisleItemsIntoIndexes methos of WineNameController,,,!!");
[masterAisleItemListDictionary release];
masterAisleItemListDictionary = [[NSMutableDictionary alloc] init];
CustomerDetails *currentElement;
for ( currentElement in filteredListCount)
{
NSArray *timeStampArray = [currentElement.timeStamp componentsSeparatedByString:@" "];
NSString *dateStr = [timeStampArray objectAtIndex:0];
printf("\n dateStr....%s",[dateStr UTF8String]);
NSMutableArray *indexArray = [masterAisleItemListDictionary objectForKey:dateStr];
if (indexArray == nil)
{
indexArray = [[NSMutableArray alloc] init];
[masterAisleItemListDictionary setObject:indexArray forKey:dateStr];
[indexArray release];
}
[indexArray addObject:currentElement];
}
masterAisleItemListIndexArray = (NSMutableArray*)[ [masterAisleItemListDictionary allKeys] sortedArrayUsingSelector:@selector(compare:)];
}
Anyone's help will be much appreciated.
Thank's for all,
Lakshmi.