首页 > 解决方案 > 如何在字典中附加一个数组(名称)和一个字典项在 plist 中的同一数组下?

问题描述

我正在创建一个测验应用程序,并想创建一个用户会话功能,用户可以在其中输入用户名开始玩。我有一个附加到 plist 的一般想法,但我完全不确定如何在这个分支级别附加(字典>数组>字典)所以我想知道如何添加用户名数组并添加一个由 2 个键组成的项目字典,时间和分数进入用户名数组。这是 plist 的样子:

在此处输入图像描述

标签: arraysswiftxcodedictionaryplist

解决方案


Just point mouse at the end of the item in Key column, the (+) and (-) will appear, hit (+). Be sure to expand an array or dictionary before, by clicking the small arrow on the left, otherwise the newly added item will be outside.

Property List

If you can't catch the (+) with the mouse, try Editor > Add Item.


推荐阅读