Hi all,
I'm working on a dictionary which is holding all kinds of info that will be used all over in the app.
My question is.. How can I 'add' variables instead of overwriting it all ?
My dictionary is going to hold multiple dictionaries.
How can I add a new dictionary that is already set up with a temporary holder, into my main dictionary
This is overwriting all values inside main. However I just want to add this temp dictionary to the main. How can I do this ?
-----
Temporary solved by workaround.
Looking into core data or sqlite3
I'm working on a dictionary which is holding all kinds of info that will be used all over in the app.
My question is.. How can I 'add' variables instead of overwriting it all ?
My dictionary is going to hold multiple dictionaries.
How can I add a new dictionary that is already set up with a temporary holder, into my main dictionary
Code:
NSMutableDictionary *temp = [NSMutableDictionary alloc] initWithObjectsAndKeys: nil];
while(....) {
[temp setObject: @"testy" forKey: @"variable"];
...
}
[mainDictionary setObject: temp forKey: @"main"];
This is overwriting all values inside main. However I just want to add this temp dictionary to the main. How can I do this ?
-----
Temporary solved by workaround.
Looking into core data or sqlite3
Last edited: