iOS file system

Source: Internet
Author: User

In an iOS system, each app's files are independent, and the file system most processed by an app is limited to the app's sandbox folder. When the new app is installed, a series of file directories are generated, as shown in:

Let's take a look at this separately:

Appname.app: Resources that contain apps and responses, etc.

Documents: Store user generated data, the data in this folder can be manipulated by the user, can be itune backup.

Documents/inbox: If the app allows other apps to open, put the files that other apps can use in this file.

Library: There are a few folders, cache: storage caches, Preference: Store Some configuration information, Nsuserdefault information is placed in this folder. The files in this file are data that is not allowed to be manipulated directly by the user.

TMP: temporary folder, save some temporary information, the program will be cleared when exiting

How to get this file path:

//Get the program home directorynshomedirectory ();//Get the program directoryNsarray *paths =nssearchpathfordirectoriesindomains (Nsapplicationdirectory, Nsuserdomainmask, YES);//Document DirectoryNsarray *paths =nssearchpathfordirectoriesindomains (NSDocumentDirectory, Nsuserdomainmask, YES); NSString*documentpath = [Paths Objectatindex:0];//Library DirectoryNSString *librarypath = [Nssearchpathfordirectoriesindomains (nslibrarydirectory, Nsuserdomainmask, YES) Objectatindex:0];//Preference DirectoryNSString *preferencepath = [LibraryPath stringbyappendingformat:@"/preference"]; //Cache DirectoryNSString *cachepath = [LibraryPath stringbyappendingformat:@"/caches"]; //tmp directoryNSString * Tmppath = [Nshomedirectory () Stringbyappendingformat:@"/ tmp"];

  

iOS file system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.