Advertisement
Guest User

Untitled

a guest
Jan 1st, 2020
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. NSArray *predicates = [[NSMutableArray alloc] init];
  2. for (NSInteger i = 0; i < [neighbourUIDs count]; i++) {
  3.     NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF.neighbourhood ==[c] '%1$@'", neighbourUIDs[i]];
  4.     [predicates addObject:predicate];
  5. }
  6. NSString *hq = @"Headquarters";
  7. NSPredicate *hqPredicate = [NSPredicate predicateWithFormat:@"SELF.neighbourhood ==[c] %@", hq];
  8. [predicates addObject:hqPredicate];
  9.  
  10. NSPredicate *finalPredicate = [NSCompoundPredicate orPredicateWithSubpredicates:predicates];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement