This is not a valid predicate format string, so even if you finish generating it, you cannot convert it to NSPredicate
Here you want instead:
NSDictionary *groupValuePairs = ....;
NSMutableArray *subpredicates = [NSMutableArray array];
for (NSString *group in groupValuePairs) {
NSArray *values = [groupValuePairs objectForKey:group];
NSPredicate *p = [NSPredicate predicateWithFormat:@"%K IN %@", group, values];
[subpredicates addObject:p];
}
NSPredicate *final = [NSCompoundPredicate andPredicateWithSubpredicates:subpredicates];
, . , :
NSDictionary *groupValuePairs = ....;
NSMutableArray *subpredicates = [NSMutableArray array];
for (NSString *group in groupValuePairs) {
NSArray *values = [groupValuePairs objectForKey:group];
NSMutableArray *groupSubpredicates = [NSMutableArray array];
for (NSString *value in values) {
NSPredicate *p = [NSPredicate predicateWithFormat:@"%K contains[cd] %@", group, value];
[groupSubpredicates addObject:p];
}
NSPredicate *p = [NSCompoundPredicate orPredicateWithSubpredicates:groupSubpredicates];
[subpredicates addObject:p];
}
NSPredicate *final = [NSCompoundPredicate andPredicateWithSubpredicates:subpredicates];