Saving image in sqlite versus application's documents directory

Discussion in 'iOS Programming' started by arnieterm, May 27, 2009.

  1. arnieterm macrumors regular

    Joined:
    Aug 28, 2008
    #1
    Hello all,
    I am working on an iphone application that requires saving images. I would like to know what is the best way to store these images
    Saving in sqlite table or in documents directory of the application

    Though currently I am saving the images in documents directory and the respective path as string in the sqlite table. But here is one issue on iphone/simulator. The path generated is something like
    this [say for iphone]
    /var/mobile/app...../applicationID/Documents/myimage.png
    When we again run the application
    the applicationid changes and the above path becomes invalid and the application is not able to read the image back
    Will this problem also occurs once you upload the application on app store and makes available a new version later
    Please make me clear as well as correct me wherever appropriate

    Thanks
    Arnieterm
     
  2. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #2
    Best is to save the images as files in the file system.

    Don't save the full path. Save the path relative to a known path, like the Documents folder.
     

Share This Page