I have a NSArray
of AEMEvent
custom objects. One of the properties of this AEMEvent
class is startDate
of type NSDate
.
@interface AEMEvent : NSObject
{
//.....
NSDate *startDate;
//..........
}
I would like to sort this array based on this property, so the output will be an NSArray
full of AEMEvent
objects ordered by startDate
attribute.
I have seen this interesting answer for sorting an NSArray
of NSDate
objects using -[NSArray sortedArrayUsingSelector:
or -[NSMutableArray sortUsingSelector:]
and passing @selector(compare:)
as parameter and wonder if there will be a way to use this in my situation - Sort NSArray of date strings or objects