Downloading files and save it to a hidden folder on iPhone
can some give me a good resource for the iphone filesystem? Basically I want to know:
- Where can I save my downloaded files into which folders? And which are not allowed?
- Which of these folders are hidden? (which won't be backup extracted) These files should stay on the device.
Want I'm trying to do is this: The user can download some videos from our server and watch it using our app. So I have to download the videos and save it somewhere on the iPhone, but I don't know exactly where to save these files so it won't be b开发者_如何学Pythonackup extracted.
First I tried ~/Documents
folder, but the files in there will be extracted, so not an option for me.
~/tmp
folder. This folder seems to be working for me, because it wasn't extracted, but I don't know if this folder is always present? For how long will it persist? Because its called temp, will it be cleaned after some time/event?
If someone has information for me, I would really appreciate it.
Thanks in advice,
BujuYou might want to use <Application_Home>/Library/Caches
.
From the apple docs @ https://developer.apple.com/iphone/prerelease/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/RuntimeEnvironment/RuntimeEnvironment.html#//apple_ref/doc/uid/TP40007072-CH2-SW12
Use this directory to write any application-specific support files that you want to persist between launches of the application. Your application is generally responsible for adding and removing these files. However, iTunes removes these files during a full restore of the device so you should be able to recreate them as needed.
You need to read this:
Creating Paths and Locating Directories
All of it. Carefully.
精彩评论