i know sandbox and bundle in iOS app,but what the difference? the bundle is included in the sandbox? And hao can i get the document directory by the bundle?
3 Answers
To fetch the documents directory, Use the function NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)
.
The return type is an array. Fetch the last object which is the only object in the array incase its an iOS app. That would be the path to your documents directory, a subset of the App Sandbox

- 2,009
- 5
- 19
- 19

- 11
- 2

- 3,175
- 3
- 21
- 24
-
Nice pic that explains a lot! Can you give a reference link for this as well? Thanks. – allenlinli Apr 14 '20 at 07:29
The question haunted me too. This is what I was able to conclude. The App Bundle is a subset of the App sandbox. Consider the app folder in your simulator. The folder with the App ID (16 digit Hex) is your App Sandbox. The sandox contains your documents, library, tmp and other sub directories in addition to the app bundle (.app file). Right click the app bundle and show package contents. You would find the source code and resources that make up the app bundle.
Correct me if I am wrong.

- 11
- 2