There are 5 commonly used catalogs in the APP, namely:
(1) root directory
(2) Documents
(3) Library/caches
(4) Library/preferences
(5) TMP
How do I get a catalog?
1. App root directory:
1 nsstring *homedir = Nshomedirectory ();
2. Documents directory:
1 nsarray *arrdocumentdir = nssearchpathfordirectoriesindomains (nsdocumentdirectory, NSUserDomainMask, YES); 2 nsstring *documentdir = [Arrdocumentdir firstobject];
3. The directory where caches is located:
1 nsarray *arrcachesdir = nssearchpathfordirectoriesindomains (nscachesdirectory, Nsuserdomainmask, YES) ; 2 nsstring *cachesdir = [Arrcachesdir firstobject];
4, preference does not have a corresponding Fetch directory method, because this directory mainly stores user preferences information, can be directly through the key-value pairs for read and write access, and therefore do not need to get the directory.
5. tmp directory:
1 nsstring *tempdir = Nstemporarydirectory ();
How to get a few catalogs commonly used in the APP