how is data stored on an iphone?
Hello,
I don't really understand how data is stored on the iphone (persistently).
I've looked at this answer http://developer.appcelerator.com/question/45471/how-to-save-a-remote-imagepicture-to-database-or-filesystem
But i don't really understand where the file is being saved. How to I retrieve the files I save? Do I need to create a database with information on what files I saved, or is there a way to look for files to see if they exist?
1 Answer
-
Accepted Answer
Every installed application can write to the device's filesystem in a special directory for application data. The path to this directory is stored in
Ti.Filesystem.applicationDataDirectory
. You can get a representation of this directory in code by doing:var appDataDirectory = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory);
Once there, you can access the contents through the File API.