Re: NSTableView: move rows through drag and drop?
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