Skip to content

Instantly share code, notes, and snippets.

@jamessa
Created October 1, 2011 08:43
Show Gist options
  • Save jamessa/1255775 to your computer and use it in GitHub Desktop.
Save jamessa/1255775 to your computer and use it in GitHub Desktop.
UserDefault Sample
/// Save Key
NSUserDefaults *userDefaults;
userDefaults = [NSUserDefaults standardUserDefaults];
[userDefaults setObject:api forKey:@"APIURLString"];
[userDefaults synchronize]; // save
// Get Key
NSString *currentUserIdentifier = [[NSUserDefaults standardUserDefaults] objectForKey:@"WhoAmI"];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment