可变
可变集合的特点
创建可变集合
NSMutableSet *set = [NSMutableSet set];NSSet *initialSet = [NSSet setWithObjects:@"Apple", @"Google", @"Microsoft", nil]; NSMutableSet *mutableSet = [NSMutableSet setWithSet:initialSet];
常用操作
[mutableSet addObject:@"Facebook"];NSMutableSet *set = [NSMutableSet set];
[set addObject:@"Apple"];
[set addObject:@"Google"];
NSLog(@"%@", set); // 输出的顺序是无序的示例
注意事项
Last updated