Reputation: 255
Is it ok to cast a NSdictionary object to NSMutableDictionary?
NSDictionary *dict; NSMutableDictionary *mDict = (NSMutableDictionary *)dict;
Tried this and it worked fine.
Upvotes: 0
Views: 2634
Reputation: 20236
No it is not. If you want a mutable dictionary, make one:
NSMutableDictionary* mutableDict = [dict mutableCopy];
Do not forget in accordance with the rules you own mutableDict and must release it when you are done with it.
mutableDict
Upvotes: 6