I am trying to add NSMutableArray's to a NSMutableDictionary
My code looks something like this:
[myDictionary setObject:[NSMutableArray array] ForKey: myKey];
[[myDictionary objectForKey:myKey] addObject: myString];
So what I am trying to do: I have an empty dictionary, and I want to have multiple arrays within that dictionary. Each array has it's own key. In each array I want to add a NSString, so that each array will fill up with several NSString Objects.
But, when I try to check the contents of myDictionary by using:
for(id key in myDictionary)
{
NSLog(@"key=%@ value=%@", key, [myDictionary objectForKey:key]);
}
I will only get one entry for each key. What am I doing wrong?
Thanks in advance, and sorry for the noobness