In these case, you can use this instead of myDictionary = details.coreDictionary;
.
myDictionary = [NSMutableDicationary dictionaryWithDictionary:details.coreDictionary];
Updation:
I saw that myDictionary = [NSMutableDictionary new];
, this line totally waste. Even you allocate to NSMutableDictionary, during assign with details.coreDictionary
, It will try to assign a NSDictionary
object with NSMutableDictionary
variable which means, myDictionary
try to point NSMutableDictionary
memory which leads to compile time error. Also Type casting to NSMutableDictionarymyDictionary = (NSMutableDictionary*)details.coreDictionary;
, temporary solve your problem but type casting is not correct one. After assign it, when you try to access NSMutable method, it will get crash.