的NSMutableArray
我想這樣的排列來看:排序嵌套的NSMutableArray
(
{
"title" = "Bags";
"price" = "$200";
},
{
"title" = "Watches";
"price" = "$40";
},
{
"title" = "Earrings";
"price" = "$1000";
}
)
這其中包含的NSMutableArray
個集合的NSMutableArray
。我想先按price
排序,然後按title
排序。
NSSortDescriptor *sortByPrices = [[NSSortDescriptor alloc] initWithKey:@"price" ascending:YES];
NSSortDescriptor *sortByTitle = [[NSSortDescriptor alloc] initWithKey:@"title" ascending:YES];
[arrayProduct sortedArrayUsingDescriptors:[NSArray arrayWithObjects:sortByPrices,sortByTitle,nil]];
但是,似乎沒有工作,如何排序嵌套NSMutableArray
?
它怎麼沒有工作,你之前和之後有什麼,你是如何做的那種? – Wain
它看起來像數組字典裏面 – lupatus