If you drag and drop a selection of text onto a folder, you will get a file with an extension of textClipping. TextEdit's document window accepts a text selection. Many applications do accept textClipping. How do you receive a text selection on an NSImageView drop box? The regular operation of performDragOperation doesn't appear to accept a selection of text.
- (BOOL)performDragOperation:(id<NSDraggingInfo>)sender {
NSPasteboard *pboard = [sender draggingPasteboard];
NSArray *urls;
if ([[pboard types] containsObject:NSURLPboardType]) {
urls = [pboard readObjectsForClasses:@[[NSURL class]] options:nil];
}
AppDelegate *appDelegate = (AppDelegate *)[NSApp delegate];
...
...
return YES;
}
These lines of code let me accept files, but not textClipping. What is the secret of accepting textClipping? Maybe, you can't accept it with NSImageView? Running a search with 'Objective-C textClipping' turns up nothing.
Thank you for your advice.