Skip to content

Instantly share code, notes, and snippets.

@cxa
Created September 12, 2011 02:22
Show Gist options
  • Save cxa/1210463 to your computer and use it in GitHub Desktop.
Save cxa/1210463 to your computer and use it in GitHub Desktop.
NSUserDefaults shortcut
#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)
@humbroll
Copy link

humbroll commented Dec 4, 2013

Love it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment