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

Text drop into other text apps


  • Subject: Text drop into other text apps
  • From: Alexander Reichstadt <email@hidden>
  • Date: Sun, 02 Nov 2014 18:43:58 +0000 (GMT)

Hi,

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?

Also, from the documentation on pasteboardPropertyListForType one would expect to return a property list. Property lists consist of keys and values in my understanding, but a string is just an unordered chain of characters. What would the keyes be, actually the one key, to which to assign the string @"test" then?

Thx


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

- (NSArray *)writableTypesForPasteboard:(NSPasteboard *)pasteboard
{
    return @[@"public.text"];
}

- (id)pasteboardPropertyListForType:(NSString *)type
{
    NSLog(@"%@",type);
    
    NSData *conData = [@"test" dataUsingEncoding:NSUTF8StringEncoding];

 
    return conData;
}

_______________________________________________

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: Ken Thomases <email@hidden>
    • Re: Text drop into other text apps
      • From: Mike Abdullah <email@hidden>
  • Prev by Date: Re: Auto layout without ambiguity
  • Next by Date: Re: Text drop into other text apps
  • Previous by thread: Re: hueComponent not valid for the NSColor
  • Next by thread: Re: Text drop into other text apps
  • Index(es):
    • Date
    • Thread