I'm trying to insert an object in my dictionary, but first, I want to test if it's a NSMutableDictionary :
if ([[[self.response objectForKey:@"X"] objectAtIndex:0] isKindOfClass:[NSMutableDictionary class]]) {
[[[self.response objectForKey:@"X"] objectAtIndex:0]setObject:@"Hello" forKey:@"Y"];
}
I get this issue :
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[__NSCFDictionary setObject:forKey:]: mutating method sent to immutable object'