title: Why is NSUserDefaults used in iOS?
body: <p>I am new to iOS development and Mobile app development in general, I have decent knowledge about Objective C and MVC patterns to be used and I have never done any Mac development.</p>
  
  <p>I am struggling to understand what <code>NSUserDefaults</code> is for?</p>
  
  <p>We already have something like PList which stores data as XML and we have <code>SQLite</code> which is lightweight DB for such devices.</p>
  
  <p>Then why do we have it?</p>
  
  <p>Is it an alternative simple key-value storage for our app in the same way we have different types of storage on the cloud like an RDBMS and a key-value based NoSQL store etc ?</p>
  
  <p>For <code>NSUserDefaults</code>, Apple docs say that :-</p>
  
  <p><strong>"Applications record such preferences by assigning values to a set of parameters in a user’s defaults database"</strong></p>
  
  <p>What do they mean by user's default database?</p>
  
  <p>My guess is that, like in any multi-user operating system we have various user accounts and in the same way in Mac as well we might be having multiple users each having a database from where applications would load saved preferences for that user.</p>
  
  <p>So like Mac OS X, does iOS also have multiple users and depending upon whichever is logged in <code>NSUserDefaults</code> picks his/her preferences?</p>
  
  <p>Please tell me if I am wrong.</p>