的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