0

When using InAppSettingsKit, I see a few ways that different plist files are used, 1) when using a childpane or 2) when using a list.

I want to be able to reuse a plist file but have the keys for the different settings be different. This would allow me to reuse the same file but have different settings stored. ie. something like: CommonSettings.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">
<dict>
    <key>PreferenceSpecifiers</key>
    <array>
        <dict>
            <key>Type</key>
            <string>PSMultiValueSpecifier</string>
            <key>Title</key>
            <string>A_COMMON_SETTING</string>
            <key>Key</key>
            <string>${unique}_setting_value</string>
            <key>DefaultValue</key>
            <integer>1</integer>
        </dict>
    </array>
</dict>
</plist>

Note: I'm already taking the values/titles using the valuesFor and titlesFor delegate methods for the PSMultiValueSpecifier.

One way I though about doing this was using the list functionality without an Add capability but that didn't work since the AddSpecifier seems required even though the documentation states:

Optionally, a list group also has an AddSpecifier

(My program crashed without it)

Note: I did take a look at this question but I'm already comfortable using different plist files, I'm looking to reuse them.

app_dev55
  • 31
  • 4

1 Answers1

0

IASK doesn't support a dynamic variable resolution in plists. However, you should be able to achieve this with a custom build script that generates the different plist files at compile time from one master file with variable replacement. Use /usr/libexec/PlistBuddy to work with plist files.

Ortwin Gentz
  • 52,648
  • 24
  • 135
  • 213
  • Thanks for the suggestion; are there any ways to use the delegate or extend `IASKAppSettingsViewController` to support the scenario I mention? The challenge for me is not generating the plist files, it just seems redundant and possibly avoidable. – app_dev55 Nov 14 '20 at 04:30
  • No, currently IASK doesn't support this and it's not on our roadmap. Feel free though to extend it according to your needs. – Ortwin Gentz Nov 16 '20 at 15:06