Last active
November 30, 2017 06:19
-
-
Save hmhmsh/a039fa12afa1318ef6324d19dfb386c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (id)getUserDefaultsWithKey:(NSString*)key { | |
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; | |
id value = [ud boolForKey:key]; | |
return value; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)saveUserDefaultsWithInteger : (NSInteger)value key:(NSString*)key { | |
NSUserDefaults* ud = [NSUserDefaults standardUserDefaults]; | |
[ud setIntegert:value forKey:key]; | |
[ud synchronize]; | |
} | |
// - (void)setFloat:(float)value forKey:(NSString *)defaultName; | |
// - (void)setDouble:(double)value forKey:(NSString *)defaultName; | |
// - (void)setBool:(BOOL)value forKey:(NSString *)defaultName; | |
// - (void)setURL:(nullable NSURL *)url forKey:(NSString *)defaultName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment