我有一個字典數組,它保存在應用程序的文檔目錄中 如何更新特定鍵和索引的值? 例如:我要更新第二詞典人的名字字典數組/如何更新特定鍵和索引的值?
<?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">
<array>
<dict>
<key>personName</key>
<string>John Sculey</string>
<key>isPersonAdult</key>
<true/>
<key>personID</key>
<integer>12541</integer>
<key>personPicture</key>
<string>john.jpg</string>
<key>personDesignation</key>
<string>Branding Manager</string>
<key>personDepartment</key>
<integer>2</integer>
<key>personEmail</key>
<string>[email protected]</string>
</dict>
<dict>
<key>personName</key>
<string>Chris Seattle</string>
<key>isPersonAdult</key>
<true/>
<key>personID</key>
<integer>89854</integer>
<key>personPicture</key>
<string>chris.jpg</string>
<key>personDesignation</key>
<string>Branding Manager</string>
<key>personDepartment</key>
<integer>2</integer>
<key>personEmail</key>
<string>[email protected]</string>
</dict>
等等....
是不是'[陣列objectAtIndex:1]的setObject:@ 「新名稱」 forKey:@ 「PERSONNAME」];'不夠好? – 2013-01-01 22:33:05
是的,這是足夠好:)謝謝 – yusufag