Skip to content

Instantly share code, notes, and snippets.

@pratikshabhisikar
Created August 12, 2011 07:04
Show Gist options
  • Save pratikshabhisikar/1141614 to your computer and use it in GitHub Desktop.
Save pratikshabhisikar/1141614 to your computer and use it in GitHub Desktop.
Removing Objects from an array from another array
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