我到底在这里做错了什么?沮丧到难以置信。
我有一个数组,其中包含具有属性的某种类型的对象。我们只称该属性为“数字”。它是类型NSUInteger
。
我还有一个实体,其属性为“数字”,类型为Integer 64
.
我正在尝试创建一个获取请求,该请求可以找到我的核心数据存储中的所有对象,这些对象在另一个包含对象的数组中不存在。
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
fetchRequest.entity = [NSEntityDescription entityForName:@"EntityName" inManagedObjectContext:context];
fetchRequest.predicate = [NSPredicate predicateWithFormat:@"NOT (%@.number IN number)",someArrayWithObjects];
NSError *error = nil;
NSArray *notMatchingObjects = [context executeFetchRequest:fetchRequest error:&error];
这将返回一个 nil 数组。我知道我的本地商店中有带有数字的对象,这些对象在我的其他数组中不存在。难道我做错了什么?