题
嘿,好吧,所以我有一个看起来像的。
<plist version="1.0">
<dict>
<key>Item 0</key>
<dict>
<key>Name</key>
<string>Jero</string>
<key>Initiative</key>
<integer>0</integer>
<key>EditThis</key>
<false/>
</dict>
</dict>
</plist>
In the app I have it so that when one of the rows (The data is put in a UITableView) is selected it pushes to a new view controller.我还想将“ Editthis”布尔值设置为“是”,以便编辑视图控制器可以学习编辑。但是,我似乎无法弄清楚如何更改值。任何帮助深表感谢。
解决方案
将PLIST加载到可变的词典中:
NSMutableDictionary *plist = [NSMutableDictionary dictionaryWithContentsOfFile:@"file.plist"];
[plist setObject:[NSNumber numberWithBool:YES] forKey:@"EditThis"];
[plist writeToFile:@"file.plist" atomically:YES];
不隶属于 StackOverflow