Skip to content

Instantly share code, notes, and snippets.

@cockscomb
Forked from anonymous/Only prints query once
Created December 4, 2012 10:31
Show Gist options
  • Save cockscomb/4202499 to your computer and use it in GitHub Desktop.
Save cockscomb/4202499 to your computer and use it in GitHub Desktop.
Prints Query 1
NSArray *tags = [all valueForKey:@"tag"];
NSMutableArray *adoptTags = [[NSMutableArray alloc] init];
for (NSString *tagQuery in tags) {
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"tag CONTAINS[cd] %@", tagQuery];
NSArray *roughArray = [all filteredArrayUsingPredicate:predicate];
NSArray *tagContent = [[NSSet setWithArray:roughArray] allObjects];
[adoptTags addObjectsFromArray:tagContent];
}
NSLog(@"Tags: %@", adoptTags);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment