我得到了一个如下所示的 NSMutableArray*,并尝试使用 NSPredicate 对其进行过滤,以仅根据那里的状态返回那些感兴趣的人。
执行后结果变量为空,因此由于某种原因它没有过滤,有什么想法吗?
谢谢
代码:
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"StatusId == %i", aOrderStatus ];
NSLog(@"%@", [predicate debugDescription]);
NSArray *result = [aOrdersList filteredArrayUsingPredicate: predicate];
NSLog(@"getRestaurantOrderList - result: %@", [result debugDescription]);
return [result mutableCopy];
aOrdersList 数组内容:
{
StatusId = 0;
cost = "22.950000762939";
name = "Pieter Uys";
number = 0823630937;
order = "1/4 Chicken - SPICE: L";
"order detail" = "SPICE: L";
"order title" = "1/4 Chicken";
orderNo = 2;
orderNoDisplay = ORD0000000002;
quantity = 1;
restaurant = Nandos;
time = " 20 min ";
},
{
StatusId = 0;
cost = "41.950000762939";
name = "Pieter Uys";
number = 0823630937;
order = "1/4 CHICKEN MEAL - Side: CHIPS, Drink: COKE, SPICE: L";
"order detail" = "Side: CHIPS, Drink: COKE, SPICE: L";
"order title" = "1/4 CHICKEN MEAL";
orderNo = 3;
orderNoDisplay = ORD0000000003;
quantity = 1;
restaurant = Nandos;
time = " 20:00 ";
},