Hi folks
I have a frustrating problem with a Core Data application.
I have an entity "Photograph" in a Core Data model - it has an attribute "image" which I set to be of type Transformable.
I generated the class files and changed the attribute type to NSImage* in the class header.
I created a basic XIB file and hooked up an NSImageView to the "image" attribute, using the Bindings inspector to bind the Value to an NSArrayController, specifying "selection" for the Controller Key, "image" for the Model Key Path and "NSUnarchiveFromData" for the Value Transformer.
If I drag an image file to the image view, the underlying object gets updated, and stored when the application closes.
However, if I use a button on the form to show a file dialog, select a file and try to set the current object's "image" property, the object gets updated fine (the image view shows the new image correctly) but the object doesn't seem to get stored correctly because, upon restarting the application, the image view is empty.
I have spent a couple of days trying all sorts of things - can anyone please help here?
I have a frustrating problem with a Core Data application.
I have an entity "Photograph" in a Core Data model - it has an attribute "image" which I set to be of type Transformable.
I generated the class files and changed the attribute type to NSImage* in the class header.
I created a basic XIB file and hooked up an NSImageView to the "image" attribute, using the Bindings inspector to bind the Value to an NSArrayController, specifying "selection" for the Controller Key, "image" for the Model Key Path and "NSUnarchiveFromData" for the Value Transformer.
If I drag an image file to the image view, the underlying object gets updated, and stored when the application closes.
However, if I use a button on the form to show a file dialog, select a file and try to set the current object's "image" property, the object gets updated fine (the image view shows the new image correctly) but the object doesn't seem to get stored correctly because, upon restarting the application, the image view is empty.
I have spent a couple of days trying all sorts of things - can anyone please help here?