You can explore the following:
+ (NSPredicate *)andPredicateWithSubpredicates:(NSArray *)subpredicates
+ (NSPredicate *)orPredicateWithSubpredicates:(NSArray *)subpredicates
+ (NSPredicate *)notPredicateWithSubpredicate:(NSArray *)subpredicate
With this you can actually form short predicates and join them together with arrays. So, you don't exactly get what you wished for, but its a near shot.
NSPredicate *predicate1 = [NSPredicate predicateWithFormat:@"(ANY option.playerzoneID == %d)", zoneIdType];
NSPredicate *predicate2 = [NSPredicate predicateWithFormat:@"(ANY option.gameId == %d)", SELECTED_GAME.gameID];
NSPredicate *predicate3 = [NSPredicate predicateWithFormat:@"(ANY team.teamID == %@)", SELECTED_TEAM.teamID];
NSCompoundPredicate *compoundANDPredicate = [NSCompoundPredicate andPredicateWithSubpredicates:@[predicate1, predicate2, predicate3]];
Read more about these here:http://nshipster.com/nspredicate/
Edit: Using OR Predicates along with AND Predicates:
Let's assume: you have this predicate to add as OR:
NSPredicate *predicate4 = [NSPredicate predicateWithFormat:@"(ANY team.teamName == %@)", SELECTED_TEAM.teamName];
So, you can group your AND and OR predicates into one compound predicate (compoundANDPredicate
as shown above) and then use
+ (NSPredicate *)orPredicateWithSubpredicates:(NSArray *)subpredicates
So it becomes:
[NSCompoundPredicate orPredicateWithSubpredicates:@[compoundANDPredicate, predicate4]];