Add/Remove objects from a NSMutableSet.
If you want to remove add or remove objects from NSMutableSet follow the below code-
NSMutableSet *brokenCars = [NSMutableSet setWithObjects:
@"Honda Civic", @"Nissan Versa", nil];
NSMutableSet *repairedCars = [NSMutableSet setWithCapacity:5];
// "Fix" the Honda Civic
[brokenCars removeObject:@"Honda Civic"];
[repairedCars addObject:@"Honda Civic"];
NSLog(@"Broken cars: %@", brokenCars); // Nissan Versa
NSLog(@"Repaired cars: %@", repairedCars); // Honda Civic
*Happy Coding :)
0 Comment(s)