Objective-C:NSSet和NSMutbaleSet的用法
#import<Foundation/Foundation.h> intmain(intargc,constchar*argv[]) { @autoreleasepool{ NSSet*set1=[NSSetsetWithObjects:@"a",@"b",@"c",@"d",nil]; NSSet*set2=[[NSSetalloc]initWithObjects:@"1",@"2",@"3",nil]; NSArray*array=[NSArrayarrayWithObjects:@"a",@"b",@"c",nil]; NSSet*set3=[NSSetsetWithArray:array]; NSLog(@"set1:%@",set1); NSLog(@"set2:%@",set2); NSLog(@"set3:%@",set3); //获取集合个数 NSLog(@"set1count:%d",set1.count); //以数组的形式获取集合中的所有对象 NSArray*allObj=[set2allObjects]; NSLog(@"allObj:%...