Hi,
I'm trying to understand code in a development book thats related to mutable dictionaries. The author creates an array of NSMutableDictionary items like this:
In trying to dissect the line, I consulted the documentation for NSMutableDictionary. But it lists the methods for adding entries to the dictionary as
setObject:forKey:
setValue:forKey:
addEntriesFromDictionary:
setDictionary:
Since I dont see any of those in the code, Im confused. I know a dictionary is supposed to match keys with values, so I dont know why there seem to be "extra" terms in the line.
Phil
I'm trying to understand code in a development book thats related to mutable dictionaries. The author creates an array of NSMutableDictionary items like this:
Code:
self.menuList = [[NSMutableArray alloc] init];
[menuList release];
[menuList addObject:[NSMutableDictionary
dictionaryWithObjectsAndKeys:
NSLocalizedString(@"London", @"City Section"),
kSelectKey,
NSLocalizedString(@"US dollars to pounds",
@"City Explain"), kDescriptKey,
nil,kControllerKey, nil]];
In trying to dissect the line, I consulted the documentation for NSMutableDictionary. But it lists the methods for adding entries to the dictionary as
setObject:forKey:
setValue:forKey:
addEntriesFromDictionary:
setDictionary:
Since I dont see any of those in the code, Im confused. I know a dictionary is supposed to match keys with values, so I dont know why there seem to be "extra" terms in the line.
Phil