Skip to content

Instantly share code, notes, and snippets.

@aronskaya
Last active July 8, 2019 21:00
Show Gist options
  • Save aronskaya/410da6b51228927f977decb57fac0a83 to your computer and use it in GitHub Desktop.
Save aronskaya/410da6b51228927f977decb57fac0a83 to your computer and use it in GitHub Desktop.
[NSUserDefaults]

Print global NSUserDefaults:

defaults read -g

Write a date via Terminal:

defaults write [com.myapp] [theKey] -date [2019-07-08T17:08:48Z] Writes 8th of July, 2019, 17:08:48 for theKey for domain com.myapp

Nil & NSUserDefaults

Not friends. Even with NSNull. To remove a key-value pair, call removeObject:forKey:

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