Kiran
Kiran

Reputation: 561

On Objective-C: which is the root directory in iphone

Which is the root directory in iphone and where does all the files documents will be stored? Why we are using only the NSDocument directory to copy a file in that place and then we are reading?

Upvotes: 0

Views: 900

Answers (1)

Yuji
Yuji

Reputation: 34185

For security reasons, iOS doesn't allow a program to access arbitrary files in the system. A program can only access files within its sandbox, see this Apple documentation.

A program needs to get the path to its sandbox using a public API, because the sandbox path is not known at the compile time. That's why you see what you see in the sample code.

Upvotes: 1

Related Questions