views:

15

answers:

1

How do you set up an object in interface builder that will allow the user to submit an image (like when editing a vCard in Address Book) and save it to the corresponding entry in the database being managed by Core Data?

Solution

Use an NSImageView object. On the first panel of the inspector for the object, you'll see a checkbox marked Editable that will allow you to decide whether to accept submissions or just display output.

Bindings for the object are as follows:

-> Value.Data
    Bind to: Source Entity
    Controller Key: selection
    Model Key Path: Name of the attribute within the entity storing the image data
+1  A: 

I think that NSImageView will do the trick. Link to reference: link text.

If I remember well this component is available on Interface Builder..

Jack
Ah, hadn't seen the `Editable` checkbox on the inspector for that before. Thanks!For future reference should anyone else have the same question, bindings to the `NSImageView` object work as follows: -> Value.Data Bind to: Source Entity Controller Key: selection Model Key Path: Name of the attribute which stores the image data
Kaji
Ach, forgot that you can't format replies. Will add to the original post. Thanks again!
Kaji