Skip to content

Instantly share code, notes, and snippets.

@plantpurecode
Created February 15, 2014 01:46
Show Gist options
  • Save plantpurecode/9013272 to your computer and use it in GitHub Desktop.
Save plantpurecode/9013272 to your computer and use it in GitHub Desktop.
@interface NSCountedSet (JRCountedSetAdditions)
- (NSArray *) objectsWithCount:(NSUInteger) count;
@end
@implementation NSCountedSet (JRCountedSetAdditions)
- (NSArray *) objectsWithCount:(NSUInteger) count {
NSMutableArray *array = [NSMutableArray array];
for(id obj in self) {
if([self countForObject:obj] == count) {
[array addObject:obj];
}
}
return [array copy];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment