- 4、字典
- (NSDictionary)
- 1. 创建
- + (id)dictionaryWithObjectAndKeys:obj1,key1,obj2,key2,...nil;
- - (id)initWithObjectAndKeys:obj1,key1,obj2,key2,...nil;
- 2. 获取
- - (unsigned int)count
- - (NSEnumerator *)keyEnumerator
- - (NSEnumerator *)objectEnumerator
- 3. 查找
- - (id)objectForKey:key
- 4. 其他
- - (NSArray *)keysSortedByValueUsingSelector:(SEL)selector
- (NSMutableDictionary)
- 1. 创建
- + (id)dictionaryWithObjectAndKeys:obj1,key1,obj2,key2,...nil;
- - (id)initWithObjectAndKeys:obj1,key1,obj2,key2,...nil;
- + (id)dicyionaryWithCapacity:size
- + (id)dictionary;
- - (id)initWithCapacity:size
- 2. 增加
- - (void)setObject:obj forKey:key
- 3. 删除
- - (void)removeAllObjects
- - (void)removeObjectForKey:key
- 4. 获取
- - (unsigned int)count
- - (NSEnumerator *)keyEnumerator
- - (NSEnumerator *)objectEnumerator
- 5. 查找
- - (id)objectForKey:key
- 6. 其他
- - (NSArray *)keysSortedByValueUsingSelector:(SEL)selector
复制代码
|
|