Skip to content

Instantly share code, notes, and snippets.

@CraigWilliams
Created March 10, 2010 04:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CraigWilliams/327504 to your computer and use it in GitHub Desktop.
Save CraigWilliams/327504 to your computer and use it in GitHub Desktop.
void WriteStringToPasteboard(NSString *string)
{
NSPasteboard *pb = [NSPasteboard generalPasteboard];
[pb declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:NSApp];
[pb setString:string forType:NSStringPboardType];
[pb stringForType:NSStringPboardType];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment