Reputation: 3464
I have a few files that needs to be saved for storing data such as player.json.
Right now I'm using
documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
However, it saves to the Documents directory in iOS and can be accessed from itunes. Encrypting the file will also be very RAM consuming and on some earlier devices (iOS 5c), it slows the app down. So I was thinking about moving to a folder that normal users won't be able to access it.
What are the options here? Should I create a folder in iOS for the files? Can anyone else access it?
Upvotes: 2
Views: 1521
Reputation: 1425
Read the iOS Data Storage Guideline https://developer.apple.com/icloud/documentation/data-storage/index.html If you don't want your files to be included in iTunes/iCloud backup either set 'do not backup' flag for them or move it in tmp folder. Setting this flag also ensures that your files won't ever be purged automatically => you always have access to them.
Upvotes: 1
Reputation: 95
Similar to the Documents directory, there is the Library folder, which cannot be accessed by users through itunes
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);
NSString *libraryDirectory = paths[0];
Upvotes: 3
Reputation: 9168
You can disable iTunes file sharing completely by adding this key to your Info.plist file in Xcode (click on the project, select the correct target in the left pane, and go to the Info tab in the top tab bar):
Then no files will be visible for your app at all when it is viewed in iTunes.
Upvotes: 4