• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSImageView and CoreData entity creation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSImageView and CoreData entity creation
      • From: Chris Hanson <email@hidden>
  • Prev by Date: setStandardInput Argument
  • Next by Date: Key polling NSTextField
  • Previous by thread: setStandardInput Argument
  • Next by thread: Re: NSImageView and CoreData entity creation
  • Index(es):
    • Date
    • Thread