NSMutableDictionary是可变的NSDictionary,是NSDictionary的子类.
NSMutableDictionary初始化方法
- + (id)dictionaryWithCapacity:(NSUInteger)numItems
- - (id)initWithCapacity:(NSUInteger)numItems 也可以用初始化NSDictionary的方法来初始化NSMutableDictionary
NSMutableDictionary添加元素
- - (void)setDictionary:(NSDictionary *)otherDictionary //设置当前集合的元素
- - (void)setObject:(id)anObject forKey:(id<NSCopying>)aKey //添加一个键值对
- - (void)addEntriesFromDictionary:(NSDictionary *)otherDictionary //添加otherDictionary的所有元素到当前集合中
NSMutableDictionary删除元素
- - (void)removeAllObject //删除所有元素
- - (void)removeObjectForKey:(id)aKey //删除aKey对应的值
- - (void)removeObjectsForKeys:(NSArray *)keyArray //删除keyArray中所有key对应的值
NSMutableDictionary的使用,布布扣,bubuko.com
NSMutableDictionary的使用
原文:http://www.cnblogs.com/martinhu/p/3868145.html