I have a dictionary as the value for another dictionary:
10 = {
createdate = "2012-03-20 15:04:09.125177-05";
}
I would like to set a value to the inner dictionary without having to pull it out, but
[NSDicionary setObject:forKey:]
only goes one deep. can I add another key to that? I tried
[[NSDicionary setObject:forKey:]forKey:]
but xCode didn’t like that.
Any ideas?
Assuming that your dictionaries are mutable, you can use:
To see how that works, note that it’s equivalent to this:
If your dictionaries aren’t mutable, you’ll need to do more work. First, if the outer dictionary isn’t mutable:
And if the inner dictionary isn’t mutable: