iPhone Documents directory and UIFileSharingEnabled, hiding certain documents

后端 未结 2 1746
忘了有多久
忘了有多久 2020-12-03 00:33

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

2条回答
  •  爱一瞬间的悲伤
    2020-12-03 00:59

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

    .data
    

    EDIT: Please stop downgrading this answer !
    This answer was correct at the time (remember that it was before the iPad was actually available! And there was a lot of confusion on the matter, we were still hoping for the iPad to appear in the shared devices in the Finder...).
    Today (April 2012) it is still working on the Mac but not on Windows (starting a directory name with a dot means nothing in Windows).

    Anyway, this Shared Document feature is a mess. Later they fixed it by saying that "Private Documents" should be stored in the Library Folder not in the Documents folder. But remember that developers were already using the Document folder before the iPad came.
    Don't blame me for Apple mistakes.
    Stack Overflow should have a way to mark an answer as obsolete.
    API changes, get fixed, and it renders answers obsolete.

提交回复
热议问题