I\'m developing an app that needs to cache some images from the web the images are likely to be 100x100
I just need to know which is better:
Storing images in the database is definitely not recommended by Apple, the filesystem is actually really good at locating files (images in this case) on the disk, which makes it the best solution for saving images. These were the exact same words an Apple technology evangelist used in the iPhone Tech Talk World Tour in Paris. If it are only a few images, you might get away with it, but when the number can potentially become quite large, files is the way to go.
Besides, you can use the lazy loading methods to grab the images of the disk, this will delay loading the image from disk to when it really is needed.
[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"image.png"]]
Edit: imageWithContentsOfFile does not load the image at once, thus not locking the thread, neither does it cache the image. The other method imageNamed: does lock the thread and loads the image at once, on the bright side, it does cache the image.
From past experience, storing (and retrieving) images from the file system should be a bit faster than from the DB. As for ease of handling and maintenance it only depends on what you're more familiar with: SQL scripts or iphoneOS file system functions.