Sorting Array Using NSSortDescriptor
nsarray, nssortdescriptor, objective-c
Solution
NSSortDescriptor *sortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"date" ascending:NO];
NSArray *sortedArray = [detailsArray sortedArrayUsingDescriptors:@[sortDescriptor]];
Problem
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.....