Skip to content

Instantly share code, notes, and snippets.

@jlcampana
Forked from vibrazy/NSPredicateWithBlock
Created March 18, 2013 14:23
Show Gist options
  • Save jlcampana/5187493 to your computer and use it in GitHub Desktop.
Save jlcampana/5187493 to your computer and use it in GitHub Desktop.
BOOL proVersion = YES;
if (proVersion) {
return;
}
//create predicate and filter the results
NSPredicate *freePredicate = [NSPredicate predicateWithBlock:^BOOL(id evaluatedObject, NSDictionary *binding) {
InAppGame *game = (InAppGame *)evaluatedObject;
return game.isFree;
}];
NSArray *filteredArrays = [resultsArray filteredArrayUsingPredicate:freePredicate];
if ([filteredArrays count] > 0) {
[self.resultsArray removeAllObjects];
[self.resultsArray addObjectsFromArray:filteredArrays];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment