Re: Pasteboard question
Re: Pasteboard question
- Subject: Re: Pasteboard question
- From: Graham Cox <email@hidden>
- Date: Sat, 24 May 2008 14:14:07 +1000
On 24 May 2008, at 6:36 am, Davide Scheriani wrote:
[pboard declareTypes:[NSArray arrayWithObject:NSGeneralPboard]
owner:self];
Wow. That's possibly one of the weirdest bits of code I've seen for a
while :)
Do read this:
http://developer.apple.com/documentation/Cocoa/Conceptual/CopyandPaste/index.html
and this:
http://developer.apple.com/documentation/Cocoa/Conceptual/DragandDrop/index.html
The above should be something like:
NSPasteboard* pb = [NSPasteboard generalPastebord];
[pb declareTypes:[self myListOfPasteboardTypes] owner:self];
But actually for drag and drop of rows in a table view, or dragging
data into or from a table view, you don't use the general pasteboard
anyway, but the dragging pasteboard. To do this you need to register
your table view to receive the dragging types you want, then implement
the NSDraggingDestination (and to drag from, the NSDraggingSource)
protocol. The docs linked above should tell you what you need to know.
Throw away the code you posted, it's too far gone.
hth,
G.
_______________________________________________
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