• 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: Text drop into other text apps
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Text drop into other text apps


  • Subject: Re: Text drop into other text apps
  • From: Ken Thomases <email@hidden>
  • Date: Sun, 02 Nov 2014 13:11:37 -0600

On Nov 2, 2014, at 12:43 PM, Alexander Reichstadt <email@hidden> wrote:

> I'd like to write @"test" to the pasteboard in response to a tableview drag to end up in another app's textfield.
>
> I see that all my methods are called accordingly, but when I release the mouse button, nothing is inserted nor does the cursor react by reflecting the insertion point if the mouse button was released.
> What else is needed to do this?

> - (id<NSPasteboardWriting>)tableView:(NSTableView *)tableView
>               pasteboardWriterForRow:(NSInteger)row
> {
>     return self;
> }

Why not just return the string here?  NSString conforms to NSPasteboardWriting.  Then your other methods wouldn't be necessary.

As to why your drop is not being accepted, have you called -setDraggingSourceOperationMask:forLocal: on the table view to set an operation mask for the non-local case (passing NO for the second parameter)?  You would probably want NSDragOperationCopy | NSDragOperationGeneric.

Regards,
Ken


_______________________________________________

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: Text drop into other text apps
      • From: Alexander Reichstadt <email@hidden>
References: 
 >Text drop into other text apps (From: Alexander Reichstadt <email@hidden>)

  • Prev by Date: Re: Text drop into other text apps
  • Next by Date: Re: Editing NSOutlineView Group Item
  • Previous by thread: Re: Text drop into other text apps
  • Next by thread: Re: Text drop into other text apps
  • Index(es):
    • Date
    • Thread