简体   繁体   中英

InAppSettingsKit: How to customize the individual titles of added items from a PSChildPaneSpecifier?

I'm using InAppSettingsKit to create a section in my app's in-app settings where the user can add a number of custom items, each of which has its own set of properties (a string value and an int value).

To do this, I'm following the example mentioned in the docs under the heading Extending Child Panes , and demonstrated in the InAppSettingsKit sample app , where in my Root.plist, a dictionary item with an AddSpecifier of type PSChildPaneSpecifier is added, pointing to a child plist file with each item's individual properties.

This works great; except for that each user-added item appears in the main settings display with the exact same name. (Namely, whatever value is in the Root.plist in the AddSpecifier dictionary's key child element; I'm currently using the value "Tag", following the example in the sample app.)

InAppSettingsKit 视图,包含用户添加的三个 PSChildPaneSpecifier 项

Obviously, it would be hard for the user of my app to distinguish between any of these identically-named items, in order to edit the properties of a particular one of them.

How can I customize the displayed titles for each of these individual user-added PSChildPaneSpecifier items?

Ideally, I'd like the name for each of these user-added items displayed on the main IASK settings page to match the user-entered string-type title that the user entered for that item on the child pane.

The problem turned out to be that in the ItemSpecifier dictionary element (sibling to the AddSpecifier dictionary with type PSChildPaneSpecifier ), I had inadvertently omitted the Key child element.

Adding to my ItemSpecifier dictionary a child element named Key with type String and value set to the same value as the Key value in my child plist file of the String-type element whose user-entered value I wanted to have show up as the name of the element in my main IASK settings page did the trick.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM