I've been searching for a way to ensure that my objective-c/cocoa application can clear the general pasteboard when it exits. So far every tutorial/doc that I've found will tell you how to add data to the pasteboard, but not delete it.
For example, I have the following code in my app:
I've tried using the same code in my AppController's dealloc routine using the string @"", but I can still paste "foo" well after the application exits. Any ideas?
For example, I have the following code in my app:
Code:
NSPasteboard *pb = [NSPasteboard generalPasteboard];
[pb declareTypes: [NSArray arrayWithObject:NSStringPboardType] owner: self];
[pb setString: @"foo" forType: NSStringPboardType];
I've tried using the same code in my AppController's dealloc routine using the string @"", but I can still paste "foo" well after the application exits. Any ideas?