Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
695 views
in Technique[技术] by (71.8m points)

file - iPhone Documents directory and UIFileSharingEnabled, hiding certain documents

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

Instead, store private documents in Library/Preferences

According to Apple:

In addition to the directories documented previously, the entire /Library directory has always been preserved during updates and backups, except for /Library/Caches. Because of this, applications can create their own directories in /Library/ and those directories will be preserved in backups and across updates. To minimize the risk of name collisions, we recommend that you name this directory carefully. For example, a directory named Private Documents would be a good choice. You should store any files you don't want to share to Library/Preferences.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...