Created
August 12, 2011 07:04
-
-
Save pratikshabhisikar/1141614 to your computer and use it in GitHub Desktop.
Removing Objects from an array from another array
This file contains 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
NSMutableArray *parentArray = [[NSMutableArray alloc] initWithCapacity:5]; | |
for (int i = 0; i < 5; i++) { | |
[parentArray addObject:[NSNumber numberWithInt:i]]; | |
} | |
NSMutableArray *childArray = [[NSMutableArray alloc] initWithObjects:[NSNumber numberWithInt:0], [NSNumber numberWithInt:1], nil]; | |
[parentArray removeObjectsInArray:childArray]; | |
NSLog(@"%@", parentArray); | |
[childArray release]; | |
[parentArray release]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment