objective c - CoreData (for iphone) storing images -


I wonder if it is an intelligent choice to store images with binary data in binary property

I have a collection of movies and I want to save the DVD cover in an image, which is the average size of a cover of 20/30 kb (320x480px)

The reason I want to do this For storage management, once I

I'm not sure that this is a good idea, Eta load, speed?

Does anyone have experience with this?

I think archiving images in main data is not a good idea, and I'm pretty sure I've read it in Apple's programming guides too. Just consider this, when you bring your collection, all the images will also be loaded into memory, even if you are only showing 8 images, your entire image collection will be loaded with core data.

If you want to make sure to delete the image files when a move record is deleted, then I recommend that you listen to the notification by Managed ObjectTontext and delete the files when the movie is deleted:

You can register for a WiSAway or a Dishwave Notification, each with its own advantages / disadvantages.

  [[NSNotificationCenter defaultCenter] addObserver: auto selector: @selector (contextDidSave :) name: NSManagedObjectContextDidSaveNotification object: managedObjectContext];  

Obtaining deleted objects:

  - (zero) reference DIDS: (nsnification *) notification {NSDimation * User Infoc = [notification user info]; (For NSManagedObject * currObject [userInfo objectForKey: NSDeletedObjectsKey]) To delete the file related to {// code NSManagedObject, you can still access the properties of // managed object}}  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -