/*
NSSet *set1 = [[NSSet alloc] initWithObjects:@"张三 ",@"性别不明", @"⾮非地球物种", nil];
NSArray *array = [set1 allObjects];
for (int i = 0; i < [array count]; i++) {
NSLog(@"%@", [array objectAtIndex:i]);
}
//是否包含对象
if ([set1 containsObject:@"name"]) {
NSLog(@"yes");
} else {
NSLog(@"no");
}
NSSet *set2 = [[NSSet alloc] initWithObjects:@"张三",@"性别不明", @"地球⽣生物", nil];
//判断集合1和集合2是否碰撞
if ([set1 intersectsSet:set2]) {
NSLog(@"yes");
} else {
NSLog(@"no");
}
if ([set1 isEqualToSet:set2]) {
NSLog(@"yes");
} else {
NSLog(@"no");
}
//集合2是否是集合1的⼦子集
if ([set1 isSubsetOfSet:set2]) {
NSLog(@"yes");
} else {
NSLog(@"no");
}
*/
NSMutableSet *mSet1= [[NSMutableSet alloc] initWithObjects:@"aaa", @"sss", @"ddd", @"dfg",
@"fgfd", nil];
NSMutableSet *mSet2= [[NSMutableSet alloc] initWithObjects:@"sss", @"dfg", @"drf", nil];
//数组1 减去数组2
// - (void)minusSet:(NSSet *)otherSet;
// [mSet1 minusSet:mSet2];
// NSLog(@"%@", mSet1);
//数组拼接
// - (void)unionSet:(NSSet *)otherSet;
[mSet1 unionSet:mSet2];
NSLog(@"%@", mSet1);