I have 4 database catalogues in my app, i will be switching the four catalogues.
When i start the app, i read the NSUserDefaults and try to load the default catalogue in the memory, but in the first time this doesnt happen. Instead i get null values returned first time just because the DB connection is not successful for some unknown reason, the debugger is unable to go there too.
But the app starts up the next time, the values are fetched successfully.
Please help
If your trying to fetch some necessary data from the user defaults, it might not be there the first time you run the app. You probably need to create a default set of defaults (heh) using:
-[NSUserDefaults registerDefaults:]…before you query the user defaults for any value.
From User Defaults Programming Topics