Mac OSX Pasteboard

Published on Sunday, 26 July 2015

Need to copy a value to the Pasteboard?

Don't forget to clear it first.

[gist 92a8e93464a3f0f449be /]

pb.m

- (IBAction)copyURL:(id)sender {
    NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
    //pasteboard.string = txtURLEncode.stringValue;
    [pasteboard clearContents];
    [pasteboard setString:txtURLEncode.stringValue forType:NSPasteboardTypeString]; //NSStringPboardType;
}

Wordpress Original Link