Plist与不同的字符串选项

Sam*_*one 1 iphone plist ipad ios

有没有办法从源代码中添加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">
<array>
<dict>
    <key>title</key>
    <string>Title 1</string>
    //here i want to add one more string(value) how to do so?

    <key>subtitle</key>
    <string>Subtitle 1</string>
    <key>image</key>
    <string>image1.png</string>
</dict>
Run Code Online (Sandbox Code Playgroud)

我想要的是plist ...

Key Type Value value value

<?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>title</key>
    <string> 1</string>
    <string> 2 </string> 
     <string> 3</string>
    </dict>
 </Plist>
Run Code Online (Sandbox Code Playgroud)

Zap*_*hod 5

不幸的是,词典使用Key/Value范例,这意味着给定键只有一个值.但是您可以设置包含两个字符串的数组,例如:

<key>title</key>
<array>
    <string>Title 1</string>
    <string>Title 2</string>
</array>
Run Code Online (Sandbox Code Playgroud)