我加載字典從的.plist這樣的:我應該釋放添加到從文件初始化的字典中的對象嗎?
switches = [NSMutableDictionary dictionaryWithContentsOfFile:
[[NSBundle mainBundle] pathForResource:@"Switches" ofType:@"plist"]];
[switches retain];
現在我需要添加一個新的條目(這是另一個字典)給它。要創建字典並添加它,我這樣做:
NSMutableDictionary *newObject = [[NSMutableDictionary alloc]init];
[switches setObject:newObject forKey:@"MyNewObject"];
我必須發佈newObject
?我的意思是,我認爲switches
無論如何都會照顧它,對吧?