I have an array of class A objects, let it be detailsArray.
Class A has date, name as properties.
Can any one suggest a good method to sort this array based on date?
How can I use NSSortDescriptor
to sort this array? I know sorting array of dictionary using NSSortDescriptor
...
Any help is greatly appreciated.....
NSSortDescriptor *sortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"date" ascending:NO];
NSArray *sortedArray = [detailsArray sortedArrayUsingDescriptors:@[sortDescriptor]];