当以下任何一个 NSPredicate 被自己使用时,它们会按预期返回数据。但是,当我进行复合搜索时,不会返回任何内容。我的搜索有什么问题?我正在使用 NSFetchRequest 搜索核心数据
NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:@"File"];
NSPredicate *rootPredicate = [NSPredicate predicateWithFormat:@"fileWithContents.entityFolderRoot.object_id == %@", self.product.iqid];
NSPredicate *pathPredicate = [NSPredicate predicateWithFormat:@"fileWithContents.path == %@", self.currentFolder.path];
NSPredicate *predicate = [NSCompoundPredicate andPredicateWithSubpredicates:[NSArray arrayWithObjects:pathPredicate, rootPredicate, nil]];
request.predicate = rootPredicate;
[self performFetchWithRequest:request];