- 5、集合
- (NSSet)
- 1. 创建
- + (id)setWithObejcts:obj1,obj2,...,nil;
- - (id)initWithObjects:obj1,obj2,...,nil;
- 4. 获取
- - (NSUInteger)count;
- - (NSEnumerator *)objectEnumerator;
- 5. 查找
- - (BOOL)containsObject:obj;
- - (BOOL)member:obj;
- 6. 其他
- - (BOOL)isSubsetOfSet:nsset;
- - (BOOL)intesectsSet:nsset;
- - (BOOL)isEqualToSet:nsset;
- (NSMutableSet)
- 1. 创建
- + (id)setWithObejcts:obj1,obj2,...,nil;
- - (id)initWithObjects:obj1,obj2,...,nil;
- - (id)setWithCapcity:size;
- - (id)initWithCapacity:size;
- 2. 增加
- - (void)addObjecy:obj;
- 3. 删除
- - (void)removeObject:obj
- - (void)removeAllObjects
- 4. 获取
- - (NSUInteger)count;
- - (NSEnumerator *)objectEnumerator;
- 5. 查找
- - (BOOL)containsObject:obj;
- - (BOOL)member:obj;
- 6. 其他
- - (BOOL)isSubsetOfSet:nsset;
- - (BOOL)intesectsSet:nsset;
- - (BOOL)isEqualToSet:nsset;
- - (void)unionSet:nsset; //将nsset元素添加到集合
- - (void)minusSet:nsset; //去掉 nsset 元素
- - (void)interectSet:nsset; //交集
复制代码
|
|