Sandbox mechanism for iOS development (sandbox)

Source: Internet
Author: User

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:

    1. Each app has a storage space, which is a sandbox.
    2. Apps can't communicate with each other.
    3. Sandbox root directory structure: Documents, Library, temp.

Briefly describe the differences between documents, Library, temp:

    1. 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.
    2. 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.
    3. 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)

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.