例如,我想根据" fruit"对以下数组进行排序。按橙子,猕猴桃,苹果,芒果的顺序排列。之后,数组排序遵循相同的" fruit"中的名称升序。
<__NSArrayM 0x8aaaaa0>(
{
"unique" = 1;
"fruit" = "apple";
"name" = "James";
},{
"unique" = 2;
"fruit" = "apple";
"name" = "Jason";
}, {
"unique" = 3;
"fruit" = "orange";
"name" = "Peter";
} ,{
"unique" = 4;
"fruit" = "kiwi;
"name" = "Amy";
} ,{
"unique" = 5;
"fruit" = "kiwi";
"name" = "Lionel";
} ,{
"unique" = 6;
"fruit" = "mango";
"name" = "Jacky";
}