[[+content_image]]
J
J
JohnZoidberg2015-03-27 16:11:38
Objective-C
JohnZoidberg, 2015-03-27 16:11:38

How are the URLs for the Documents directory of an iOS app different?

In the application, I get the URL of the documents using

docURL = [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];

I get a URL like this: file:///var/mobile/Containers/Data/Application/15AB92D0-C7BA-4449-AB7B-10488A16E3D7/Documents/
Then I get the contents of this directory via NSDirectoryEnumerator, and the URL of its subdirectories is already displayed as file: ///private/var/mobile/Containers/Data/Application/15AB92D0-C7BA-4449-AB7B-10488A16E3D7/Documents/testfolder/
i.e. "private" is also added.
Why are these URLs so different? How to get URL immediately with "private"?

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
A
An, 2015-03-27
@JohnZoidberg

Right here is discussed
But, it shouldn't bother you at all. The fact is that Apple changes something all the time and it is better to store relative paths to files in your application.
Changes in iOS 8 are a great confirmation of this.

A
AmikoYuki, 2015-03-27
@AmikoYuki

What's the point of bothering? /var is just a sim link to /private/var

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question