You haven't declared ownership of the pasteboard, so I imagine the system is somewhat confused. Fairly sure you need to do:

[pboard declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:self];
[pboard setString:str forType:NSStringPboardType];

On 25 Sep 2009, at 02:58, Todd Heberlein wrote:

I have an NSTableView and I have Drag & Drop working between table views for my application where I encode the object to an NSData and write it to the NSPasteboard. But now I want to create a string representation of the object, add it to the pasteboard as well, and then when the object is dragged to something like an email, the string representation of the object is written in. The content does seem to be written to the pasteboard, but the "drop" doesn't seem to happen in an appropriate target (email message, editor, etc.)

The same basic code works in -copy: but it doesn't seem to work in - tableView:writeRowsWithIndexes:toPasteboard:

The line of code is:

        [pboard setString:str forType:NSStringPboardType];

Is there something different with the NSPasteboard passed into - tableView:writeRowsWithIndexes:toPasteboard: versus the pasteboard you get from [NSPasteboard generalPasteboard]? Any suggestions on what I am doing wrong?

Thanks,

Todd

_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net

This email sent to [email protected]

_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to