Question

I'm looking for a way of adding a selection of dynamic cells to the InAppSettingsKit table. Essentially what I want to do is have a ChildPane that has a selection of settings that are populated based on the contents of another plist (the contents of which will change).

The reason I require this is as follows. As user should be able to create a bunch of named items, associated with each of these items will be a number. This number will be incremented elsewhere within the app, however what I need is a way of allowing the user to set the initial value of this number via the settings page. That way the number displayed elsewhere in the app with be the sum of the value in the settings menu and the value that has been calculated elsewhere in the app.

The way I was think of approaching this problem was to populate a plist file within the app that gets updated every time a new item name is added within the app. However my concern is that this won't work due to the plist being in the documents directory as opposed to the main bundle.

Please could someone offer some advice or suggestions?

Thanks in advance!

Was it helpful?

Solution

I think you’ve 3 options:

  1. Create a custom subclass of IASKSettingsReader that is based on your dynamic schema (never did that but it should be possible, perhaps with some slight modifications of the IASK core). IASKSettingsReader reads the settings schema from the Settings.bundle (or InAppSettings.bundle) and provides it to the rest of IASK.

  2. If the settings schema for each named item is static, you could get away with just a custom IASKSettingsStore. This class provides the interface to NSUserDefaults (IASKSettingsStoreUserDefaults) or a file (IASKSettingsStoreFile). You'd need to prepend the key with the name or number of the child pane or something similar.

  3. Create your custom TableView outside IASK using IASKViewControllerClass and IASKViewControllerSelector as described in the README. Doesn't use IASK to display the cells but of course more flexible.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top