I have used NSSets many times in my apps, but I have never created one myself.
When is it better to use an NSSet as opposed to an NSArray and why?
NSArray *Arr;
NSSet *Nset;
Arr=[NSArray arrayWithObjects:@"1",@"2",@"3",@"4",@"2",@"1", nil];
Nset=[NSSet setWithObjects:@"1",@"2",@"3",@"3",@"5",@"5", nil];
NSLog(@"%@",Arr);
NSLog(@"%@",Nset);
the array
2015-12-04 11:05:40.935 [598:15730] ( 1, 2, 3, 4, 2, 1 )
the set
2015-12-04 11:05:43.362 [598:15730] { ( 3, 1, 2, 5 )}