The IOS app can read and write files in its own sandbox, but it doesn't have access to the sandbox of other apps. Each app is an island of information that can not be communicated to each other, except through URL Scheme. The files inside the sandbox can be photos, sound files, text, attribute lists, and so on.
Introduction to sandbox mechanism
Sandbox brief:
- Each app has a storage space, which is a sandbox.
- Apps can't communicate with each other.
- Sandbox root directory structure: Documents, Library, temp.
Briefly describe the differences between documents, Library, temp:
- Documents: This directory is used to store user data, itunes Backup and restore, so Apple recommends that the file data created in the program or browsed in the program be saved in that directory.
- Library: consists of two subdirectories: Caches and Preferences. Caches is used to store the files that the user needs to change. Preferences is the app's preferences and can be read and set through Nsuserdefaults.
- tmp: for storing temporary files, this can put some files that are no longer needed when the app exits.
Open the emulator sandbox method
Method One: Go to Folder open
Go to the folder directly at Finder->, and enter the contents above. Remember to replace the Ligang with your computer user name.
Method Two: Through the Finder step by step Search
The app sandbox on the emulator is actually in the repository under the user directory, but the repository is a hidden folder. So the hidden folder is now displayed before the sandbox is viewed. Show commands for hidden files:
defaults write com.apple.finder AppleShowAllFiles -bool true
The heart of the children's shoes will find, hide hidden files command:
defaults write com.apple.finder AppleShowAllFiles -bool false
To find the steps, look at the diagram:
About the sandbox mechanism (sandbox) is probably the case, in the future when the interview in case you can answer.
?
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Sandbox mechanism for iOS development (sandbox)