NSImageView and CoreData entity creation
NSImageView and CoreData entity creation
- Subject: NSImageView and CoreData entity creation
- From: Eric Friedman <email@hidden>
- Date: Sat, 17 Sep 2005 08:55:11 -0700
I have a CoreData model with two entities: Person and Picture.
Picture has a String attribute "caption" and a binary attribute
"data."
Person has a relationship to a Picture.
In my nib, there is master-detail view for Person objects. In the
detail area, I have an NSImageView whose data binding is pointed to
selection.picture.data.
I would like users to be able to drag and drop pictures onto this
NSImageView and have that do several things at once: (a) instantiate
a Picture; (b) set the selected Person's relationship attribute to
point to that instance; and (c) store the dropped image in the
Picture's data attribute.
I'm guessing I'll need a subclass of NSImageView to intercept the drag
and drop "edit" operation, and perform these steps. I experimented
with overriding -(void) setImage:(NSImage *)image, but that seems to
go into a loop, probably because it gets called by coredata.
What's the right way to implement this?
Eric
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden