Question

I'm using an Utility Application.

On the flip side I have a slider which I want to use for setting the (in-app) User Preference.

Say the user sets the value of the slider to 40 in the flip window, then click "Done" and return to the main window. The main window will use this value of 40. Also, the value has to stay persistent even after the application is closed / open or the device (iphone, ipad) is switched off / on.

Can you please example or point me to documentation on how do I do that? Is this done with Settings.bundle? Many thanks!

Was it helpful?

Solution

Store and retrieve your values using NSUserDefaults.

CGFloat value = [[NSUserDefaults standardUserDefaults] floatForKey:@"valueKey"];

To read, and to write:

[[NSUserDefaults standardUserDefaults] setFloat:value forKey:@"valueKey"];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top