How may I find a certain string (value) in an NSSet?
Must this be done using predicates? If so, how?
NSMutableSet *set = [[NSMutableSet alloc] init];
[set addObject:[[[NSString alloc] initWithFormat:@"String %d", 1] autorelease]];
[set addObject:[[[NSString alloc] initWithFormat:@"String %d", 2] autorelease]];
[set addObject:[[[NSString alloc] initWithFormat:@"String %d", 3] autorelease]];
Now I want to check if ‘String 2’ exists in the set.
From Apple’s Developer Site:
This article from Ars Technica contains some more information on using predicates. Finally Apple’s BNF guide for predicates contains information on all operations one might need.