How to set initial values for NSUserDefault Keys?
You should use the registerDefaults method of NSUserDefaults. Prepare a plist file in your bundle that contains the default preferences and then use that plist to register the defaults. NSString *defaultPrefsFile = [[NSBundle mainBundle] pathForResource:@”defaultPrefs” ofType:@”plist”]; NSDictionary *defaultPreferences = [NSDictionary dictionaryWithContentsOfFile:defaultPrefsFile]; [[NSUserDefaults standardUserDefaults] registerDefaults:defaultPreferences]; You have to execute this code on every launch of your … Read more