我想编辑数组字典中的特定值(在key:thumbnailImage下)。例如,我想将thepark.png改为theplace.png。我如何在目标C中做这件事?我也制作了一个plist的副本,以从appbundle的文档文件夹。在ios平台的数组字典中编辑Plist值
下面是我的plist的样本:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>location</key>
<array>
<string>The Park</string>
<string>The Coffee Place</string>
<string>The Center Fountain</string>
</array>
<key>timestamp</key>
<array>
<string>Not found yet</string>
<string>Not found yet</string>
</array>
<key>thumbnailImage</key>
<array>
<string>thepark.png</string>
<string>thecoffeeplace.png</string>
<string>thecetnerfountain.png</string>
</array>
</dict>
</plist>
大概在info.plist中写入不是好主意,它不起作用,因为您正试图将字典写入应用程序包中的.plist文件,该文件夹是只读的。因此,它不会工作,也会有更多的拒绝机会。 – Smita
我编辑了我的问题,实际上我已将一个副本发送到文档文件夹。 – user2531679
http://stackoverflow.com/questions/1680367/changing-data-in-a-plist –