Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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?

— asked November 21st 2010 by Nick Bodmer
  • download
  • file
  • iphone
  • system
0 Comments

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.

    — answered November 21st 2010 by Kevin Whinnery
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.