我收到 NSDictionary 产品列表的回复
{
"products": {
"title": "Chair",
"regular_price": "2.22",
"dimensions": {
"width": "",
"height": "",
"length": ""
},
"attributes": [{
"options": ["11\/30\/2016"],
"name": "Arrival Date"
}, {
"options": ["Black"],
"name": "Color"
}],
"categories": ["28"]
}
}.....
使用 NSPredicate 我可以过滤包含值“Chair”的产品
let namepredicate = NSPredicate(format: "title == Chair")
self.filteredProducts = (self.product).filteredArrayUsingPredicate(namepredicate)
但是如何过滤属性内的“颜色”、“黑色”和另一个数组(Swift)中的“黑色”?