I am developing an iPhone application, I encounter a problem on the iOS4 because of multi task.
This application has the default settings defined in a Settings.bundle.
If I run my application then I left it (so it goes in the background).
I’ll change the settings and restarts the application (it comes out of standby and method: applicationDidBecomeActive () is called).
Values in NSUserDefault are not updates, but when I leave the application and relaunch. The values are good.
Does someone experience the same problem as me?
Is what I’m doing something wrong?
Thank you for your advice / help.
I had the same problem as you, and got around it by calling
in
applicationDidBecomeActive.For some reason the
[NSUserDefaults standardUserDefaults]object you can access in your app isn’t synchronized with the actual plist files backing it when an app becomes active again after having been suspended. Calling thesynchronizemethod forces a synchronization.