Re: string into clipboard
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.