Welcome to the Treehouse Community
Looking to learn something new?
NSDictionary/NSMutableDictionary, literals and key,object sequence.
I need a grey area cleared up regarding 'key/object' sequence vs 'object/key' sequence. So I guess the question is if you use literals when defining dictionary is the sequence always going to be 'key/object' regardless of NSDictionary or NSMutableDictionary. OR does the 'Key/Object' sequence always apply to NSMutableDictionary.
Also when adding to a mutableDictionary is the adding sequence flexible, for example from video it is being added 'object then key' can that sequence be reversed please reference below code from video
//Adding to dictionary, sequence as presented in video [mutableBook setObject:@"1957" forKey:@"year"];
//Can that be written in the following more logical way in line with a //key/object sequence when adding as it feels it would be more tidy [mutableBook forKey:@"year" setObject:@"1957" ];
I would look at this
But as far as I can see it does not look like you can write it the second way. Someone feel free to correct me if I'm wrong.