Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • NSMutableSet

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 287
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: