When I read a plist for a dictionary which is not empty and has at-least one key value pair into an NSMutableDictionary property of my model class, Everything works fine.
I can add,delete modify the mutable dictionary.
But when the dictionary is empty
and you can see the plist with a tag like this :
<dict/>
Then, even though my property has an NSMutableDictionary pointer, Object which is created becomes immutable.
and when I try to set an object in it for a particular property,
It gives me this error saying:
'NSInternalInconsistencyException', reason: '-[__NSCFDictionary setObject:forKey:]: mutating method sent to immutable object'
1 Answer