iosimagethree20

iOS loading local images from path


I am developing iPad app which reads data (around 5000 rows) from sqlite and displays thumbnail images. Only file name is saved in db. I am using Three20 library.

I could successfully load and display images by using documents:// So the user needs to copy around 15000 images (thumbnails, big image & actual images) to documents folder, using iTunes file sharing.

I am not sure if is this correct approach.
Can I read images directly from photo library or using documents is correct approach?


Solution

  • Your app cant directly access file system beyond its sandbox environment. But letting user copy the thumbnails is also bad thing to do as far as my point of view. I think we should reduce the work for the user.

    1. You can download images from a remote url. (if not available[for first time] an store in Documents and reuse it).
    2. If these images are predefined then you could add it to bundle when making the build, and access it from there. But it will definitely increase the build size.