Skip to content

Instantly share code, notes, and snippets.

@chinmaygarde
Created October 30, 2014 05:25
Show Gist options
  • Save chinmaygarde/34c315da14b4cc6e6097 to your computer and use it in GitHub Desktop.
Save chinmaygarde/34c315da14b4cc6e6097 to your computer and use it in GitHub Desktop.
NSMutableSet *aSet = [[NSMutableSet alloc] init];
// add NSDictionary objects to aSet
NSDictionary *aDictionary = @{@(1) : @"1"};
[aSet addObject:aDictionary];
// Now test for membership
if ([aSet containsObject:aDictionary]) {
NSLog(@"set contains object");
}
else {
NSLog(@"set does NOT contain object");
}
NSMutableSet *newSet = [NSMutableSet setWithSet:aSet];
if ([newSet containsObject:aDictionary]) {
NSLog(@"newSet contains object");
}
else {
NSLog(@"newSet does NOT contain object");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment