Skip to content

Instantly share code, notes, and snippets.

View sag333ar's full-sized avatar

sagar kothari sag333ar

View GitHub Profile
@sag333ar
sag333ar / setoperations.m
Last active December 29, 2015 17:09
Set operations in Objective-C
// SET A - SET B ------------------------
// an array that contains many objects
NSMutableArray *arForAll = [NSMutableArray arrayWithObjects:@"1",@"2",@"Nimit",@"sagar",@"3", nil];
// an array which is sort of subset of above array.
NSMutableArray *selForSelected = [NSMutableArray arrayWithObjects:@"Nimit",@"sagar", nil];
// create a set with array - major set.
NSMutableSet* set1 = [NSMutableSet setWithArray:arForAll];