Can NSUserDefaults be used instead of a database?
I am new to iOS, so please spare me if I am asking something that everyone knows or something is wrong.
I need to store some arrays and references in my application. So instead of a database, I used NSUserDefaults
. I know what NSUserDefaults
contains the values ββuntil we uninstall the app or clear the app data. So I just need to know what can be used NSUserDefaults
instead of using a database?
source to share
NSUserDefaults
It is usually used to store small pieces of data such as application settings, preferences, and individual values ββsuch as email, remember me, etc. options.
So, based on the amount of data you plan to store in your application, if items fall into the above category, NSUserDefaults can be used. But when it comes to entering a significant amount of data such as item collection, checklist, contacts, etc., it is better to look at other ways to save it to the database.
To get started, you can take a look at these Github libraries to help you if you want to take a database approach. FMDB , OLCOrm
Hope the answer to your question :)
source to share