iOS apps have their own app sandbox (the app sandbox is the file system directory) and are isolated from other file systems. Applications must be in their own sandbox, other apps cannot access the sandbox Z application package: Contains all the resource files and executables
(more exciting, in public ioscoding, daily push iOS cutting-edge technology)
Ždocuments: Saves data that needs to be persisted when the app runs, and when itunes synchronizes the device, it backs up the directory. For example, a game app can save a game archive in that directory
Žtmp: Save the temporary data required for the app to run, and then delete the corresponding file from the directory when you are finished using it. When the app is not running, the system may also purge files in that directory. itunes syncs the device without backing up the directory Žžlibrary/caches: saves data that needs to be persisted when the app runs, and itunes syncs the device without backing up the directory. Non-critical data with large storage volumes and no backup required Žžlibrary/preference: Save all preferences for your app, and the iOS settings (settings) app will find the app's settings information in that directory. This directory is backed up when itunes syncs the device
You can set the show hidden file and then open it directly under finder. Here's how to set up viewing hidden files: Open terminal, enter name
command to display Mac hidden files: Defaults write Com.apple.finder appleshowallfiles-bool true to hide Mac hidden files command: Defaults write Com.apple.finder Appleshowallfiles-bool false After you click Enter to exit the terminal, restart the finder.
Restart Finder: Mouse click the Apple icon in the upper-left corner of the window and force exit-->finder-->
//1.get the Sandbox root path method one// not recommended because a new version of the operating system may modify the directory nameNSString*home =nshomedirectory();
//2.documentPathNSString*docpath = [Homestringbyappendingpathcomponent:@ "Documents"];//get Sandbox path method two//nsuserdomainmaskRepresentative from the user folder to find//YESRepresents the wavy character "~" in the expanded path//In iOS, only one directory matches the parameters passed in, so there is only one element in the collectionNsarray*array =Nssearchpathfordirectoriesindomains(nsdocumentdirectory,Nsuserdomainmask,YES);
NSString*documents = [ArrayObjectatindex:0];NSLog(@"%@", documents);
ZTmp:nsstring *tmp = Nstemporarydirectory ();Zlibrary/caches:(withDocumentssimilar to2kind of Method)uStitching the "Caches" string with the sandbox rootuUse the Nssearchpathfordirectoriesindomains function (change the function's 2nd parameter to: nscachesdirectory)ulibrary/preference: Access to settings information in this directory through the Nsuserdefaults class
iOS data storage iOS File system introduction