Dynamic settings in the application

I have an application where the place is important. Currently, I have a parameter with several values ​​in the parameter set, where I have 5 locations defined. The problem with this approach is that the set of settings is static - that is, I cannot update this from the JSON list on my server, as far as I know.

I want to update the list of locations from a dynamic list on the server.

I looked at InAppSettingsKit, but it also uses standard configuration packages. Can I use InAppSettingsKit to dynamically import settings updates from a remote list.

Are there other ways to do what I'm trying to do?

+4
source share
2 answers

You cannot dynamically change the list with respect to Settings.app. Settings.app always uses the static scheme template from your application package. (You can resort to a free-form text field, but that probably won't catch your case.)

With InAppSettingsKit you can do this, but you need to do extra work: for dynamic parts, you will want to use a custom view controller , such as a table view controller.

+3
source

The best way to handle this is to store the multi-valued values ​​in NSUserDefaults and start using them. In this method you will be able to update the values, and will also be stored for several sessions.

Edit (comment replies):

Save user defaults.

NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys: @"your Object", "Your Key" nil]; [[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults]; [[NSUserDefaults standardUserDefaults] synchronize]; 

Remove it:

 [[NSUserDefaults standardUserDefaults] integerForKey:@"Your Key"]; 
-1
source

All Articles