Any other ways to access Documents Directory on iDevice Locked State?

428 views Asked by At

I am implementing Music Player application in iOS platform. Here I am storing and retrieving the media contents using Documents directory. So I can't able to access the 'Documents Directory' when iPhone is getting locked with passcode. I referred Apple developer library, they said the Encryption & Decryption is comes under the accessing the file contents from documents directory. So if device is getting locked the Decryption key is Destroyed. Here I have attached the Screen shot of Problem Description. I was stuck with this problem last 2 months. Pls give me any other ways to access the Documents directory at locked state. Not Only Media , Any other content*.

Thanks in Advance.

Screen Shot

Apple Developer Site: https://developer.apple.com/library/mac/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html

1

There are 1 answers

3
Sean Kladek On

You need to specify the file protection level as an option when you write your files. Example:

[someData writeToFile:filePath options:NSDataWritingFileProtectionNone error:&error];

In this, someData is an NSData representation of the data you want to write to disk, filePath is the string path where you want to save the file.

Read the documentation on NSDataWritingOptions in the NSData Class Reference for more encryption options.