In my viewWillLoad: method I\'m currently doing something along these lines:
- (void)viewWillAppear:(BOOL)animated {
NSUserDefaults *defaults = [
You should provide defaults in your code using -registerDefaults:
. This is typically done in an +initialize
method for whatever class uses the settings. See Using NSUserDefaults.
Using the initialize method works but I like this other answer on stackoverflow that has code to read the default values from the bundle and uses them to initialize the defaults. That way you don't have to hardcode the default settings in the code, they are in the plist where they belong.