Skip to content

Instantly share code, notes, and snippets.

Created October 22, 2013 19:34
What would you like to do?
This is a class with static methods for saving user defaults.
#import "Preferences.h"
@implementation Preferences
NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
return [defaults valueForKey:forKey];
+(void)setUserPreference:(id)value forKey:(NSString*)key
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:value forKey:key];
[defaults synchronize];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment