我正在从 .plist 加载字典,如下所示:
switches = [NSMutableDictionary dictionaryWithContentsOfFile:
[[NSBundle mainBundle] pathForResource:@"Switches" ofType:@"plist"]];
[switches retain];
现在我需要向它添加一个新条目(这是另一个字典)。要创建字典并添加它,我这样做:
NSMutableDictionary *newObject = [[NSMutableDictionary alloc]init];
[switches setObject:newObject forKey:@"MyNewObject"];
我必须释放newObject
吗?我的意思是,我认为switches
无论如何都会处理它,对吧?