IOS persistent storage

What is data persistent storage?

The so-called persistence is to save data to the hard disk so that the previously saved data can be accessed after the application or the machine restarts.

What is the sandbox mechanism?

By default, iOS programs can only access the program's own directory, which is called the "sandbox". The directory structure is as follows:

"Application package": It stores the source files of the application, including resource files and executable files (such as multimedia files).

Documents:最常用的目录,适合存储重要数据。

Caches:适合存储体积大,不需要备份的非重要数据。

Preferences:通常保存应用的设置信息。

tmp:系统可能在应用没运行时就删除该目录下的文件,所以此目录适合保存应用中的一些临时文件。

One: plist file storage:

Two: preferences (preference)

Three: NSKeyedArchiver (Archive)

Four: SQLites (small databases)

Five: coreData (database is more advanced than sqlite)

Guess you like

Origin blog.csdn.net/Momo_Da/article/details/104962799