I have an app that uses several different user defaults that need to be used as soon as the app loads. One of these is responsible for zooming in on a map view to the users location.
The issue I’m having is that when I load the values of the user defaults it seems to think they are null until I change them via the settings app.
What is happening here? I’m using iOS 5, not sure if that has any impact on it. It’s just really annoying because my app relies on having the data available upon loading.
NOTE: It works absolutely fine after I change/re-select the values in the settings view.
Make sure your calling
synchronizeafter setting a value:Edit to answer comments:
From the documentation for
-registerDefaults::So, in
-applicationDidFinishLaunching:, you can register yourRoot.plistdefaults like this: