Domanda

Ci sono vari modi per le applicazioni iPhone per salvare dati (ad esempio:. NSUserDefault, XML, documento, SQLite, ecc).

La nostra azienda utilizza sempre NSUserDefault per salvare i dati. Tuttavia, non credo che NSUserDefault è molto buono perché nella mia esperienza, è stato lento.

Sono curioso di sapere come si memorizzano i dati per le applicazioni e quando si consiglia di utilizzare ciascuno dei diversi metodi. Si prega di condividere le vostre esperienze che aiuteranno a capire i vantaggi e gli svantaggi di questi diversi tipi di archiviazione e di sviluppare un'applicazione più efficiente per i miei utenti.

È stato utile?

Soluzione

You can store small data in NSUserDefaults but when you have large database then you need sqlite or coredata for storing the database. use of coredatabase is good for big database this is provided by apple and it is to efficient in accessing database.

NSUserDefaults or document directory is used for small database(suppose need to store user name for single user or some other info).

Altri suggerimenti

You just need to know about sql queries to store data in a SQLite3 Database or You can use Core Data for back end storage. Core Data is one of the best options to use for storing data.

NSUserDefault should be used for storing small information.

You can use NSUserDefaults for storing any small data which you want to persist when your application closes. This you can use to store login details but yes if it is be secured, use keychain. You can definely use NSUserDefaults for storing setting options.

SQLite database is any easy way to store large data. Core Data is best option. but you can use SQLite if your application data is not too large. SQlite Database can also be used to store BLOB data e.g. to store pdf file bytes downloaded from server and whenever you want to use it, just write those bytes to pdf file. This will also keep data security since BLOB data in SQLite cannot be viewed.

Its good to use coreData for large data storage in the IPhone Memory space. ITs a wrapper on top of the database which helps us to store in the form of objects..... U can find many examples on this...

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top