• 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: string into clipboard
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: string into clipboard


  • Subject: Re: string into clipboard
  • From: Nicko van Someren <email@hidden>
  • Date: Thu, 5 Feb 2004 09:27:05 +0000

On 5 Feb 2004, at 8:22, Guillaume Rager wrote:

i just want to put an NSString in Clipboard, i use that

[[NSPasteboard generalPastboard] setString:aString forType:NSStringPboardType];

... but it doesn't seem to be the right way, because i cannot see the string into the Finder clipboard or find the string into another application.

Did you remember to call -(int)declareTypes:(NSArray *)newTypes owner:(id)newOwner before you set the string?

The documentation says:
Prepares the receiver for a change in its contents by declaring the new types of data it will contain and a new owner. This is the first step in responding to a users copy or cut command and must precede the messages that actually write the data.

You should be able to use:
[[NSPasteboard generalPastboard] declareTypes: [NSArray arrayWithObject: NSStringPboardType] owner: nil];

Cheers,
Nicko
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >string into clipboard (From: Guillaume Rager <email@hidden>)

  • Prev by Date: Converting Japanese C- string to NSString
  • Next by Date: Re: string into clipboard
  • Previous by thread: string into clipboard
  • Next by thread: Re: string into clipboard
  • Index(es):
    • Date
    • Thread