One Quickie


Put a string on the pasteboard (NSString->Random)
Here's a category for easily putting a string on the paste|clipboard:
@implementation NSString (PasteboardGoodies)

- (void) sendToPasteboard
{
        [[NSPasteboard generalPasteboard] 
            declareTypes: [NSArray arrayWithObject: NSStringPboardType]
            owner:nil];
        [[NSPasteboard generalPasteboard]
            setString: self
            forType: NSStringPboardType];
} // sendToPasteboard

@end // PasteboardGoodies
Thanks to Dan Jalkut for this tip.



borkware home | products | miniblog | rants | quickies | cocoaheads
Advanced Mac OS X Programming book

webmonster@borkware.com