• 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
Re: NSTableView: move rows through drag and drop?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView: move rows through drag and drop?


  • Subject: Re: NSTableView: move rows through drag and drop?
  • From: Jens Alfke <email@hidden>
  • Date: Wed, 10 Aug 2011 14:11:38 -0700

On Aug 9, 2011, at 8:43 PM, Izak van Langevelde wrote:

> Now I want to allow drag and drop from one document to another, and my first guess was to write the row data to the pasteboard.
> What puzzles me, is how to delete the row data from the source data, in case of a move. That is, my acceptDrop inserts the row data into the destination data source, but the indexes of the source rows are not available at this point.

And also consider that the destination of the drag could be a different app, in which case you don’t get an -acceptDrop: call at all.

Instead, to handle the source end of a move (or delete, i.e. drag to Trash) you need to implement the NSDraggingSource protocol’s -draggedImage:endedAt:operation: method. If the operation was a move or delete, you should delete the dragged items.

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSTableView: move rows through drag and drop?
      • From: Izak van Langevelde <email@hidden>
References: 
 >NSTableView: move rows through drag and drop? (From: Izak van Langevelde <email@hidden>)

  • Prev by Date: Re: NSTableView: move rows through drag and drop?
  • Next by Date: Re: Font in TextFieldCell in Matrix
  • Previous by thread: NSTableView: move rows through drag and drop?
  • Next by thread: Re: NSTableView: move rows through drag and drop?
  • Index(es):
    • Date
    • Thread