12

I was wondering if anyone could suggest the best way for me to store images for my app.

I want to be able to provide an XML update functionality that will allow the user to update their app with a new set of images. I was wondering what the best way to do this was as i need to read and write to the store location. Is storing them in a sqlite database the best way or am i able to use the filesystem to do this without the chance of the iPhone deleting any of the downloaded images?

Thanks

anton91
  • 993
  • 2
  • 10
  • 12
  • 1
    Use the filesystem. There is some good discussion here: http://stackoverflow.com/questions/10918319/can-downloaded-images-files-be-added-to-my-app-bundle?rq=1 – rmaddy Jan 21 '13 at 00:30
  • thanks @rmaddy, thats more or less what i need to do! Thanks! – anton91 Jan 21 '13 at 23:30

2 Answers2

14

You can write to the filesystem, every app in iOS is sandboxed and has access to his own documents folder.

I would suggest to write on filesystem and only save the urls on the database as that is more performant than saving blobs on a database.

Apple has a good write up about the iOS filesystem.

pablasso
  • 2,479
  • 2
  • 26
  • 32
1

Alternatively you could implement a solution using SQLite, Apple mentions it in the: Large Data Objects (BLOBs) section here:

https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CoreData/Articles/cdPerformance.html#//apple_ref/doc/uid/TP40003468-SW5