views:

73

answers:

1

I have a large amount of images that correspond to records in a sqlite db. where should I store them? I have 3 versions of the same image - large, med, thumb sizes. (I don't want to store them in the db table, but reference them instead from each record)

all the images have the same name - each small, med and large image files would all be called "1.jpg" for record 1 in the sqlite table etc... this is mainly because I'm using an image batch resizing program that retains the same file name and creates a new folder.

thanks for any help.

+1  A: 

For my cached images, I stored them in TMP folder, you can access using NSTemporaryDirectory.

I don't know if it is good for your cases or if it is good in general but it works quite well

vodkhang
That works except if you actually want to keep them around indefinitely. The temp folder can be deleted by the OS at a whim. Hence the temp part.
Kalle
I have 500+ records in an sqlite table and need to have images (thumb, med, large) associated w/ each record. so, i have to figure out where to store them.
hanumanDev
@hanumandev: so, you want to store it forever, right? I am not sure but I think you should only keep some references on mobile side and most data on server side. Then, after images are deleted by OS, you can still loads from server?
vodkhang
yes, store them forever w/ the app. I was thinking that if they are stored on a server then the user won't have access to them if they loose their network connection. also there would be a delay every time a new image downloads.
hanumanDev
To be honest, I don't have a perfect solution for you. I think that a quite good solution is like I talked, keep them in the tmp directory and then expect (sorry that it is not sure) the OS does not delete it (which is not regularly). If they delete it, then you may need to download it again from server side
vodkhang
I am also trying to ask a new question here http://stackoverflow.com/questions/3593900/iphone-storage-in-tmp-directory
vodkhang
You may try with the cache directory according to the new answer to my questions
vodkhang
so, – Marcus S. Zarra said that "To be backed up and not deleted, it needs to be in the documents directory."that makes sense. that's I've I'm doing. it will end up being 100mb of images.
hanumanDev
yeah, I think 100 mb of images is quite a lot if you store in some weak iphone with 8gb. But, you may try
vodkhang