NSSet *set=[NSSet set];
NSSet *set1=[NSSet setWithObjects:@"jack",@"rose", nil];
//存取数据的个数
NSInteger count=[set1 count];
NSLog(@"%ld",count);
//随机拿取元素
NSString *str=[set1 anyObject];
NSLog(@"%@",str);
//通过数值创建集合
NSArray *arr=[NSArray arrayWithObjects:@"2",@"1",@"3", nil];
NSSet *set2=[[NSSet alloc]initWithArray:arr];
//集合中是否包含内容为“1”这个字符串对象
BOOL result=[set2 containsObject:@"1"];
NSLog(@"%d",result);
//判断两个集合是否含有相同元素
BOOL result1=[set1 intersectsSet:set2];
NSLog(@"%d",result1);
//集合1是否是集合2的子集合
BOOL result2=[set1 isSubsetOfSet:set2];
NSLog(@"%d",result2);