我想在字典的数组中设置项目。我在下面有一个 NSDictionary,一个名为“currentCityNode”的实例。在该字典中是一个数组项(除其他外)。数组项名为“TheConnections” 下面的代码成功读取了数组。
NSArray *theConnectionsArray = [currentCityNode objectForKey:@"TheConnections"];
(theConnectionsArray now contains the previously loaded values '3','7', and '9')
现在我想在这个数组中设置一个值。将第二个值“7”设为“5”。
我已经尝试了一些变化,但还没有得到它。
[currentCityNode addObject:notsurewhattoputhere forKey:@"TheConnections"];