我正在遍历NSArrayof NSDictionaries,然后我想使用if 语句NSDictionary类型中的其中一个值BOOL。但是我在执行此操作时遇到了一些麻烦。
这就是我的for loop样子
for(NSDictionary *dict in arrayOfDictionaries)
{
NSNumber *boolCheck = [dict objectForKey:@"ISREADY"]; // isReady is the bool value which is either 0 or 1
if (boolCheck == [NSNumber numberWithBool:YES]) {
//...
}
}
正在发生的事情是它循环通过我的数组,但从未满足我的 if 语句的条件,即使我 100% 确定数组中有这种类型的值......而且其中有很多。
任何帮助,将不胜感激。