set集合_变长
//set可变集合//便利初始化函数分配大小NSMutableSet *mutableSet1 = [[NSMutableSet alloc] initWithCapacity:3];NSMutableSet *mutableSet2 = [NSMutableSet setWithCapacity:3];Z
//添加元素
[mutableSet1 addObject:@"aaa"];[mutableSet1 addObject:@"BBB"];[mutableSet1 addObject:@"bbb"];NSLog(@"%@",mutableSet1);
//删除元素[mutableSet1 removeObject:@"ccc"];NSLog(@"%@",mutableSet1);
//遍历SetNSArray *setArray = [mutableSet1 allObjects];NSLog(@"%@",mutableSet1);

浙公网安备 33010602011771号