views:

821

answers:

2

I want the user to be able to access the files in the documents directory but am using core data and dont want the user to be able to access the store (the sqllite db), can i hide it from the user while still allowing file sharing, or can i put it in another directory where it will still get backed up?

A: 

In the documents directory, create a subdirectory which name starts with a dot. For example:

.data
FenchKiss Dev
this is just the straight unix files that start with a '.' are hidden?so this will still get backed up, i.e. the entire contents of the documents directory gets backed up?
Aran Mulholland
Having tested this on a device, the standard unix hidden dir works fine and is backed up.
Marcus S. Zarra
+1  A: 

The answer given by FrenchKiss Dev is not correct. The user will still be able to see the ".data" directory in iTunes and save that locally with all the files inside it. You should store any files you don't want to share to Library/Preferences.

Harkonian
This is incorrect. The .data is hidden from iTunes and putting things in Library/Preferences is a bad idea per the development documentation
Marcus S. Zarra
Thank you M.Zarra. I hadn't seen this.My answer is correct of course.I don't know which way is the best practice though.
FenchKiss Dev
It's unfortunate that I've been ranked down. My answer is correct. I have an app in the app store that I needed to enable iTunes sharing and I did extensive testing on it. I can, in fact see the directory my app created. I can click on that directory and download it. The directory is in no way hidden. This is on a Windows machine and with system files/hidden files set to visible. My understanding is that this does not work in iTunes on OSX, but it certainly does in Windows.
Harkonian
Holtwick