Google News
logo
IOS - Interview Questions
How can you implement storage and persistence in iOS?
Persistence means storing data on the disk so that it can be retrieved without being altered the next time the app is opened. From simple to complex, there are the following methods for storing data : 
 
* Data structures such as arrays, dictionaries, sets, and other data structures are perfect for storing data intermediately.
* NSUserDefaults and Keychains are both simple key-value stores. NSUserDefaults is insecure, whereas Keychains is secure.
* A file or disk storage is a way to store data (serialized or not) to or from a disk using NSFileManager.
* Relational databases, such as SQLite, are good for implementing complex querying mechanisms.
Advertisement