I'm new to Core Data and I'm working on my first personal iOS app.
I have an entity, lets call it Car
, which has a thumbail as well as a gallery of other images associated with it. The data is synced to an online service using ASIHTTPRequest
and JSONKit
. The app doesn't need to create new Car
's, just display them.
The thumbnail could be around 100kB so I may store that as blob data within the Car
entity.
However I'm not sure how I should store the other multiple images?
The images would be around 800kB to 1MB each using so storing them in the Core Data store doesn't seem to be recommended.
The only options I can think of are:
- Store the url of each photo within another entity
CarImage
and rely onASIHTTPRequest
's cache. - Create a folder structure and save each image into it's corresponding
Car
's folder and keep references to the file path in theCarImage
entity
Because the data is synced, there is the potential for Car
's to be deleted, so images in folders would have to be deleted as well. I can see this getting out of hand pretty quickly.
I would appreciate any advice. Thanks.