I can't convert an image on disk to a NSData object and store the
data in my Core Data model.
I have a Core Data application where one of the entities has a data
attribute which I use to store an image. In the UI, the image is
displayed in an image view with bindings and an data unarchiver
formatter. If I drag and drop an image into the image well,
everything works fine.
My model class also has a method to receive the URL to an image and I
am trying to create the data object from the incoming URL without any
luck. I have tried dataWithContentsOfURL, creating an image and
converting that to a data object, but I always get the same error
when I set the data object to my model: +[NSUnarchiver
unarchiveObjectWithData:]: extra data discarded
Any help greatly appreciated. I tried on Apple's Cocoa list with no luck.