Created
September 12, 2011 02:22
-
-
Save cxa/1210463 to your computer and use it in GitHub Desktop.
NSUserDefaults shortcut
This file contains 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
#define DEFAULTS(type, key) ([[NSUserDefaults standardUserDefaults] type##ForKey:key]) | |
#define SET_DEFAULTS(Type, key, val) do {\ | |
[[NSUserDefaults standardUserDefaults] set##Type:val forKey:key];\ | |
[[NSUserDefaults standardUserDefaults] synchronize];\ | |
} while (0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Love it.