There are four data storage modes on the iPhone:
Property lists property list
Object archives (or archiving) object Archiving
Sqlite3 (IOS's embedded relational database)
Core Data (Apple's provided persistence tool)
In storage, we often need to extract two related directory paths: documents and TMP.
Getting the documents directory:
Nsarray * paths = nssearchpathfordirectoriesindomains (nsdocumentdirectory, nsuserdomainmask, yes );
Nsstring * documentsdirectory = [paths objectatindex:0];
Nsstring * filename = [documentsdirectory stringbyappendingpathcomponent:@"Thefile.txt"];
Getting the tmp directory:
Nsstring * temppath = nstemporarydirectory ();
Nsstring * tempfile = [temppath stringbyappendingpathcomponent:@"Tempfile.txt"];
File storage is divided into single-file storage and multi-file storage (Single-file persistence, multiple-file persistence)