You want to use the addEntriesFromDictionary:dic3
method on NSMutableDictionary
:
dic1 = [[NSMutableDictionary alloc] initWithDictionary:dic2];
[dic1 addEntriesFromDictionary:dic3];
Question
a silly question: How do i fit multiple dictionaries together in one or add one to an other? i tried to initialize my dictionary with two other.. it didn't work.
dic1 = [[NSMutableDictionary alloc] initWithDictionary:dic2, dic3];
thank you
Solution
You want to use the addEntriesFromDictionary:dic3
method on NSMutableDictionary
:
dic1 = [[NSMutableDictionary alloc] initWithDictionary:dic2];
[dic1 addEntriesFromDictionary:dic3];