我有一个由字典填充的数组,我需要根据字典中一个键的值按字母顺序对数组进行排序.
这是我的数组:
tu dictus: (
{
brand = Ryul;
productTitle = Any;
quantity = 1;
subBrand = "Ryul INJ";
type = Product;
},
{
brand = Trol;
productTitle = Different;
quantity = 2;
subBrand = "";
type = Brand;
},
{
brand = Dtor;
productTitle = Any;
quantity = 1;
subBrand = "";
type = Product;
},
{
brand = Ryul;
productTitle = Different;
quantity = 2;
subBrand = "Ryul CHES";
type = SubBrand;
},
{
brand = Anan;
productTitle = Any;
quantity = 1;
subBrand = "";
type = Product;
}
)
通常我会使用数组排序
myArray = [uniqueProdsArray sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)];
但是如何使用字典的brand
键进行排序呢?