Created
July 16, 2012 15:06
-
-
Save datwelk/3123209 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSArray *names = @[@"Name", @"Name2", @"Name3", @"Name4"]; | |
NSMutableArray *predicateStrings = [NSMutableArray array]; | |
[names enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { | |
[predicateStrings addObject:[NSString stringWithFormat:@"firstName == %@", obj]]; | |
}]; | |
NSString *predicateString = [predicateStrings componentsJoinedByString:@" || "]; | |
NSPredicate *predicate = [NSPredicate predicateWithFormat:predicateString]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment