开发者

Order of data in plist file?

开发者 https://www.devze.com 2023-01-30 10:26 出处:网络
Below is my plist file. When I pull out those inner dictionaries and display them, they are only displayed alphabetically BUT I would want them to be pulled out as they are in the plist and then be ab

Below is my plist file. When I pull out those inner dictionaries and display them, they are only displayed alphabetically BUT I would want them to be pulled out as they are in the plist and then be able to append another inner dictionary OR order the existing ones. Is there another better approach for 开发者_开发百科what i'm trying to do?

<plist version="1.0">
<dict>
    <key>z-key</key>
    <dict><key></key><string></string></dict>
    <key>a-key</key>
    <dict><key></key><string></string></dict>
    key>k-key</key>
    <dict><key></key><string></string></dict>
</dict>
</plist>

Many thanks, Bilal


Make the top level container an array instead of a dictionary. Arrays are ordered, dictionaries are not.

0

精彩评论

暂无评论...
验证码 换一张
取 消