Change application settings through settings bundle while application is running IOS
I have written code in -(void)applicationWillEnterForeground:(UIApplication *)application , but my application is not detecting the change made in the settings bundle, new settings work when application restart开发者_开发问答s, someone please help me how to make changes in application's settings while application is running
Try to -(BOOL)synchronize;
the NSUserDefaults
.
After setting the values in NSUserDefaults
try calling [[NSUserDefaults standardUserDefaults] synchronize];
so that the values get written to disk.
in your applicationWillEnterForeground: methode after this line
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults], add this line
[defaults synchronize];
精彩评论