I have NSMutableArray named "allConversations" that contains a custom class "Users".
every user have property "lastMessageDate".
e.x : user.lastMessageDate;
what is the best way to sort the array by date?
I have this code :
NSMutableArray *arrCopy = [[NSMutableArray alloc]initWithArray:unSortedArr];
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"lastMessageDate" ascending:TRUE];
[arrCopy sortUsingDescriptors:[NSArray arrayWithObject:sortDescriptor]];
but I don't know how to implement it in this situation
lastMessageDateinstead ofcreatedAt?