I have an array of data like so.
{
"first_name"="John",
"last_name"="Lock"
};
{
"first_name"="John",
"last_name"="Lee"
};
{
"first_name"="Melinda",
"last_name"="Abman"
};
I was able to sort by first name like so:
NSArray *sortedArray = [tablearray sortedArrayUsingDescriptors:[NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"first_name" ascending:YES]]];
But is there a simple way to sort by firstname then lastname? Basically do the equivalent of SELECT * FROM users ORDER BY first_name ASC, last_name ASC ?