我有NSArray
和NSDictionaries
。其中一个数组中的一个字典键包含一个值。我想用该值检索NSDictionary
。从NSArray中检索NSDictionary,其中字典键具有值X
我的数组:
Array: (
{
DisplayName = "level";
InternalName = "Number 2";
NumberValue = 1;
},
{
DisplayName = "PurchaseAmount";
InternalName = "Number 1";
NumberValue = 3500;
}
)
所以,我想获得它包含DisplayName
设置为PurchaseAmount
(不区分大小写)的字典。
我该如何做到这一点?
您应该能够使用'NSPredicate'了点。 [在这里看到类似的例子](http://stackoverflow.com/q/958622/119114)。 – Nate 2013-04-05 10:13:59
Thnx的小费。我会将我用过的解决方案添加到答案 – 2013-04-05 10:17:01