NSMutableDictionary和NSDictionary的区别

调用NSDictionary的removeObjectForKey报错:No visible @interface for 'NSDictionary' declares the selector 'removeObjectForKey:'

NSMutableDictionary和NSDictionary的区别

原因如下: Use NSMutableDictionary instead of NSDictionary. You can't set object in NSDictionary. You can add object in NSDictionary only in initialization of NSDictionary object.

当然除了上面,还有其它区别,但这个是最主要的,备忘。更多的操作见:http://www.cnblogs.com/wengzilin/archive/2012/03/15/2397712.html

相关阅读