问题
I have listed my app in the device setting app.Now I can change my app settings through the device app settings app. Now what I am trying to do is the reverse. I am trying to make a app so that it can itself change its preferences in the device settings app if I change the preferences of my app from within the app.
Any ideas Friends, Thank You All.
回答1:
Nice and simple:
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"MyPreferenceKey"];
NSUserDefaults
includes convenience methods for setting ints, floats, strings, and so on. You can also just use -setValue:forKey:.
When you change a value in your app using NSUserDefaults
, the setting well change in the Settings app, too.
来源:https://stackoverflow.com/questions/1459275/how-to-change-the-app-preference-settings-through-code