Created
April 15, 2015 10:30
-
-
Save frr149/8fddf5e3fea5755ec530 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
// NSSet | |
NSMutableSet *fraseChorras = [NSMutableSet set]; | |
[fraseChorras addObject:@"Tengo un cimbel matutino"]; | |
[fraseChorras addObject:@"Con la forma de un pepino"]; | |
[fraseChorras addObject:@"Tengo un cimbel matutino"]; // no se añade | |
NSLog(@"El conjunto: %@", fraseChorras); | |
// NSCountSet | |
NSCountedSet *bag = [NSCountedSet set]; | |
[bag addObject:@"Tengo un cimbel matutino"]; | |
[bag addObject:@"Con la forma de un pepino"]; | |
[bag addObject:@"Tengo un cimbel matutino"]; // se suma a su contador | |
NSLog(@"En el saco hay: %@", bag); | |
NSLog(@"Número de cimbeles: %lu", [bag countForObject:@"Tengo un cimbel matutino"]); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment