0Pricing
Objective-C iOS Development for Legacy & Enterprise Apps · Lesson

Storing Preferences with NSUserDefaults

Persist lightweight settings and user preferences in Objective-C apps using NSUserDefaults, the simplest key-value store on iOS.

What is NSUserDefaults?

NSUserDefaults is a built-in key-value store for small pieces of data — settings, flags, and preferences. It persists automatically across app launches.

When to Use It

Use it for small, simple values:

  • User toggles (dark mode on/off)
  • Last selected tab
  • Onboarding-completed flag

Do NOT use it for large data or sensitive secrets.

All lessons in this course

  1. Property Lists and Archiving
  2. Core Data Fundamentals
  3. SQLite Integration with FMDB
  4. Storing Preferences with NSUserDefaults
← Back to Objective-C iOS Development for Legacy & Enterprise Apps