• 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 Drag & Drop as a string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView Drag & Drop as a string


  • Subject: Re: NSTableView Drag & Drop as a string
  • From: Mike Abdullah <email@hidden>
  • Date: Fri, 25 Sep 2009 10:19:32 +0100

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@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

_______________________________________________

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


References: 
 >NSTableView Drag & Drop as a string (From: Todd Heberlein <email@hidden>)

  • Prev by Date: Re: App Crashing on a second AppleScript call
  • Next by Date: Re: Correct way to tell if a path is to a .bundle?
  • Previous by thread: NSTableView Drag & Drop as a string
  • Next by thread: Re: NSTableView Drag & Drop as a string
  • Index(es):
    • Date
    • Thread