문제

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!

도움이 되었습니까?

해결책

Store and retrieve your values using NSUserDefaults.

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

To read, and to write:

[[NSUserDefaults standardUserDefaults] setFloat:value forKey:@"valueKey"];
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top