Core Data OR NSUserDefaults

NSUserDefaults, as the name suggests (vaguely) should be used for storing preferences and app settings only. You should not be storing critical data and or user data into them.

Pros of NSUserDefaults:

  1. Easy to store and retrieve data.
  2. Useful for storing default values with minimum fuzz

Cons of NSUserDefaults

  • Not suitable for large data sets
  • Performance hit when you try to store and load large amount of data
  • All or nothing approach

CoreData is a full fledged persistent framework which supports large data transactions. CoreData allows you to build relational entity–attribute model for storing user data.

Pros of CoreData

  • Reliable framework to interact and query against data
  • Can be extremely fast when setup correctly (with relationships)
  • Powerful capabilities

Cons of CoreData

  • Takes time to master and learn the core concept
  • Needs proper app architecture design to be efficient
  • As you improve your app, you need to improve your data architecture as well
  • Migrating to new versions can be a pain if you are not careful.
Show your support

Clapping shows how much you appreciated Sagaya Abdul’s story.