-
Notifications
You must be signed in to change notification settings - Fork 147
Array of Dictionaries
AP Orlebeke edited this page Apr 10, 2020
·
2 revisions
Because of how ProfileCreator displays arrays and dictionaries in the interface, preferences that involve an array of dictionaries
requires a specific format in order to display properly.
There are several important components to making this display properly:
- The base preference has a
pfm_type
ofarray
- The base preference has a single subkey with a
pfm_type
ofdictionary
with nopfm_name
key - Critically, the dictionary subkey has a
pfm_hidden
key with a value ofcontainer
- All dictionary preferences are subkeys of the single dictionary subkey
An example of this format is below.
<dict>
<key>pfm_description</key>
<string>ARRAY OF DICTIONARIES DESCRIPTION</string>
<key>pfm_name</key>
<string>ARRAY_OF_DICTIONARIES_KEY</string>
<key>pfm_subkeys</key>
<array>
<dict>
<!-- vv IMPORTANT COMPONENT vv -->
<key>pfm_hidden</key>
<string>container</string>
<!-- ^^ IMPORTANT COMPONENT ^^ -->
<key>pfm_subkeys</key>
<array>
<dict>
<key>pfm_description</key>
<string>PREF 1 KEY DESCRIPTION</string>
<key>pfm_name</key>
<string>PREF_1_KEY</string>
<key>pfm_title</key>
<string>PREF 1 FRIENDLY NAME</string>
<key>pfm_type</key>
<string>string</string>
</dict>
<dict>
<key>pfm_description</key>
<string>PREF 2 KEY DESCRIPTION</string>
<key>pfm_name</key>
<string>PREF_2_KEY</string>
<key>pfm_title</key>
<string>PREF 2 FRIENDLY NAME</string>
<key>pfm_type</key>
<string>string</string>
</dict>
</array>
<key>pfm_type</key>
<string>dictionary</string>
</dict>
</array>
<key>pfm_title</key>
<string>NAME OF ARRAY OF DICTIONARIES</string>
<key>pfm_type</key>
<string>array</string>
</dict>
When formatted correctly, this is the result:
GUI
XML